1 | Value is a matrix. |
0 | Value is not a matrix. |
ListValue | List to check whether it forms a matrix. |
Note that we do consider the empty string to be a valid matrix (0x0).
For fully-featured matrix packages, you may want to check out matrix and report.
% set MyMatrix {{1 2 3} {4 5 6} {7 8 9}}
{1 2 3} {4 5 6} {7 8 9}
% IsMatrix $MyMatrix
1
% set NotMatrix {1 {2 2} {3 3 3}}
1 {2 2} {3 3 3}
% IsMatrix $NotMatrix
0