MatrixQ
[m]True
if m is a list of equal-length lists.MatrixQ
[m, f]True
only if f[x]
returns True
for when applied to element x of the matrix m.MatrixQ[{{1, 3}, {4.0, 3/2}}, NumberQ]
These are not matrices:
MatrixQ[{{1}, {1, 2}}] (* first row should have length two *)
MatrixQ[Array[a, {1, 1, 2}]]
Supply a test function parameter to generalize and specialize:
MatrixQ[{{1, 2}, {3, 4 + 5}}, Positive]
MatrixQ[{{1, 2 I}, {3, 4 + 5}}, Positive]