The NCol() and NRow() functions return the number of columns and rows in a matrix (or data table), respectively:
To determine whether a value is a matrix, use the Is Matrix() function, which returns a 1 if the argument evaluates to a matrix.
Is Matrix( A ); // returns 1 for yes
Is Matrix( B ); // returns 0 for no