Scripting Guide > Data Structures > Matrices > Inquiry Functions
发布日期: 11/15/2021

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
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).