The Get As Matrix() function generates a matrix containing all of the numeric values in a data table or column:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
A = dt << Get As Matrix;
[12 59 95,
12 61 123,
12 55 74, ...]
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = Column( "Height" );
A = col << Get As Matrix;
[59, 61, 55, 66, 52, ...]
The Get All Columns As Matrix() function returns the values from all columns of the data table in a matrix, including character columns. Character columns are numbered according to the alphanumeric order, starting at 1.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
A = dt << Get All Columns As Matrix;
[21 12 1 59 95,
28 12 1 61 123, ...]
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
x = dt << Get As Matrix( {"height", "weight"} );
x = dt << Get As Matrix( {height, weight} );
[59 95, 61 123, 55 74, ...]
dt << Get Selected Rows;
dt << Get Rows Where( expression );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
A = dt << Get Rows Where( Sex == "M" );
[6, 7, 8, 12, 13, 14, ...]
The Set Values() function copies values from a column vector into an existing data table column:
col << Set Values( x );
col is a reference to the data table column, and x is a column vector.
For example, the following script creates a new column called test and copies the values of vector x into the test column:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "test" );
col = Column( "test" );
x = 1::40;
col << Set Values( x );
The Set Matrix() function copies values from a matrix into an existing data table, making new rows and new columns as needed to store the values of the matrix. The new columns are named Col1, Col2, and so on.
dt = New Table( "B" );
dt << Set Matrix([1 2 3 4 5, 6 7 8 9 10]);
This script creates a new data table called B containing two rows and five columns.
To create a new data table from a matrix argument, use the As Table(matrix) command. The columns are named Col1, Col2, and so on. For example, the following script creates a new data table containing the values of A:
A = [1 2 3, 4 5 6, 7 8 9, 10 11 12];
dt = As Table( A );
mymatrix = [11 22, 33 44, 55 66];
V Max( mymatrix ); // returns the maximum of each column
[55 66]
V Min( mymatrix ); // returns the minimum of each column
[11 22]
V Mean( mymatrix ); // returns the mean of each column
[33 44]
V Sum( mymatrix ); // returns the sum of each column
[99 132]
V Std( mymatrix ); // returns the standard deviations of each column
[22 22]

Help created on 7/12/2018