This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Tests  /

  • MatrixQ[ expr ] gives True if expr is a list of lists that can represent a matrix, and gives False otherwise.
  • MatrixQ[ expr , test ] gives True only if test yields True when applied to each of the matrix elements in expr.
  • MatrixQ[ expr ] gives True only if expr is a list, and each of its elements is a list of the same length, containing no elements that are themselves lists.
  • MatrixQ[ expr , NumberQ] tests whether expr is a numerical matrix.
  • See the Mathematica book: Section 2.3.5Section 3.7.3.
  • See also: VectorQ, TensorRank.
  • Related package: LinearAlgebra`MatrixManipulation`.

    Further Examples

    Three matrices and three non-matrices.