Scripting Guide > Data Structures > Matrices > Inquiry Functions
Publication date: 08/13/2020

Inquiry Functions

The NCol() and NRow() functions return the number of columns and rows in a matrix (or data table), respectively:

NCol( [1 2 3, 4 5 6] ); // returns 3 (for 3 columns)
NRow( [1 2 3, 4 5 6] ); // returns 2 (for 2 rows)

To determine whether a value is a matrix, use the Is Matrix() function, which returns a 1 if the argument evaluates to a matrix.

A = [20, 64, 3];
B = {20, 64, 3};
Is Matrix( A ); // returns 1 for yes
Is Matrix( B ); // returns 0 for no
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).
.