SquareMatrixQ
Details
- A matrix m is square if it has the same number of rows and columns, in which case Dimensions[m]{n,n}. »
- SquareMatrixQ works for symbolic as well as numerical matrices.
Examples
open allclose allBasic Examples (3)
Scope (9)
Basic Uses (5)
Test if a real machine-precision matrix is square:
Test if a complex matrix is square:
Test if an exact matrix is square:
Use SquareMatrixQ with a symbolic matrix:
SquareMatrixQ works efficiently with large numerical matrices:
Special Matrices (4)
Use SquareMatrixQ with sparse matrices:
Use SquareMatrixQ with structured matrices:
Use with a QuantityArray structured matrix:
Use SquareMatrixQ with an identity matrix:
Use SquareMatrixQ with HilbertMatrix:
Applications (1)
Properties & Relations (5)
For a square matrix m, Dimensions[m] gives {n,n}:
SquareMatrixQ[expr] returns False for expressions that are not matrices:
The empty list is not considered a square matrix:
A square matrix is made up of vectors of length :
Make sure it is made up of vectors:
Verify that all vectors have the same length and the number of vectors equals their length:
For lists, SquareMatrixQ[a] is equivalent to MatchQ[TensorDimensions[a],{n,n}]:
Text
Wolfram Research (2014), SquareMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareMatrixQ.html.
CMS
Wolfram Language. 2014. "SquareMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SquareMatrixQ.html.
APA
Wolfram Language. (2014). SquareMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SquareMatrixQ.html