The Get As Matrix() function generates a matrix containing all of the numeric values in a data table or column:
A = dt << Get As Matrix;
A = col << Get As Matrix;
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.
A = dt << Get All Columns As Matrix;
x = dt << Get As Matrix( {height, weight} );
dt << Get Rows Where( expression );
The Set Values() function copies values from a column vector into an existing data table column:
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:
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.
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:
dt = As Table( A );
V Max( mymatrix ); // returns the maximum of each column
V Min( mymatrix ); // returns the minimum of each column
V Mean( mymatrix ); // returns the mean of each column
V Sum( mymatrix ); // returns the sum of each column
V Std( mymatrix ); // returns the standard deviations of each column