HP Forums

Full Version: Plot specified column from matrix on HP50G
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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..
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.
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.
There are also some XY plot libraries. I'll try to find my notes from some years ago.
Haven't found my notes, but the libraries that I have on my 50g are:
Thanks Dave and Sammy for the information. I will look further into this.
Cheers / Frank
Reference URL's