SquareMatrixQ

SquareMatrixQ[m]

gives True if m is a square matrix, and False otherwise.

Details

  • A matrix m is square if Dimensions[m]{n,n} has the same number of rows and columns.
  • SquareMatrixQ works for symbolic as well as numerical matrices.

Examples

open allclose all

Basic Examples  (3)

Test if an object is a square matrix:

This matrix is rectangular:

These are not matrices:

Applications  (1)

Define a function that only evaluates for explicit square matrices:

This represents the Hermitian part of a matrix explicitly:

This does not evaluate because the matrix is rectangular:

This does not evaluate because a is not an explicit matrix:

Properties & Relations  (1)

A square matrix is made up of vectors of length :

Wolfram Research (2014), SquareMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareMatrixQ.html.

Text

Wolfram Research (2014), SquareMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SquareMatrixQ.html.

BibTeX

@misc{reference.wolfram_2021_squarematrixq, author="Wolfram Research", title="{SquareMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/SquareMatrixQ.html}", note=[Accessed: 01-August-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_squarematrixq, organization={Wolfram Research}, title={SquareMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/SquareMatrixQ.html}, note=[Accessed: 01-August-2021 ]}

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