Method on @sym: ismatrix (x)

Return true if this symbolic expression is a matrix.

This returns true for all 2D arrays including matrices, scalars, vectors and empty matrices. This function is provided mostly for compatibility with double arrays: it would return false for 3D arrays; however 3D symbolic arrays are not currently supported.

Example:

A = sym([1 2; 3 4]);
ismatrix(A)
  ⇒ 1
ismatrix(sym([1 2 3]))
  ⇒ 1

See also: @sym/isscalar, @sym/isvector, @sym/size.

Package: symbolic