HP Forums
Plot specified column from matrix on HP50G - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Plot specified column from matrix on HP50G (/thread-14578.html)



Plot specified column from matrix on HP50G - b17flyboy - 02-28-2020 01:31 AM

Hi,

A quick question regarding plotting of data stored in matrices.

How would I programmatically plot a column C from a matrix M, say where
X is the independent var that runs from 1 to 3 (in this example),
and Y is the value stored at that index (row)

Example:
M = [[11 22] [33 44] [55 66]]
X is row index of M, 1..3 inclusive
C specifies column, 1 or 2 in this case

For example, if C is 1, then plot Y values 11,33,55 for X in {1,2,3}

Using User RPL is ok, or if there is another more direct way, that would help also.

Thanks..


RE: Plot specified column from matrix on HP50G - b17flyboy - 02-28-2020 02:58 AM

I found section 2-34 in the AUR, "Programmatic Use of Statistics and Plotting".
It appears to cover using ΣDAT to hold the discrete data and displaying on the screen. I will try this out..

Thanks.


RE: Plot specified column from matrix on HP50G - Dave Britten - 02-28-2020 04:12 PM

This is taken from my 48SX manuals, but it should still apply to the 50.

Your X values will need to be a column in your matrix, i.e. they can't be an implied sequence starting at 1. Then you can use the XCOL and YCOL commands to specify which column numbers contain the x data and y data respectively. These commands simply update ΣPAR with the column numbers. On the 48SX, ΣPAR is a list with five elements: x column number, y column number, l.r. intercept, l.r. slope, regression model. The default x column is 1, and the default y column is 2.

The data needs to be in ΣDAT - this variable can either contain a matrix with the data itself, or it can contain the name of a matrix variable where the data is stored.

Once all of that is set up, use the standard statistics and plotting commands like normal.


RE: Plot specified column from matrix on HP50G - SammysHP - 02-28-2020 04:36 PM

There are also some XY plot libraries. I'll try to find my notes from some years ago.


RE: Plot specified column from matrix on HP50G - SammysHP - 02-29-2020 05:03 PM

Haven't found my notes, but the libraries that I have on my 50g are:



RE: Plot specified column from matrix on HP50G - b17flyboy - 03-01-2020 04:41 AM

Thanks Dave and Sammy for the information. I will look further into this.
Cheers / Frank