Parts of Matrices
The Wolfram Language provides several convenient methods for extracting and manipulating parts of matrices. The flexible [[ ]] (Part) and ;; (Span) syntaxes provide compact yet readable representations of operations on submatrices and matrix elements. The Wolfram Language's symbolic character also allows convenient pattern and rule-based element specifications.
Dimensions — dimensions of a matrix
MatrixQ — test whether an expression is a matrix
Part — elements and submatrices: m[[i,j]]; resettable with m[[i,j]]=x
Take — take rows, columns and submatrices
Drop — drop rows, columns and submatrices
Diagonal — get the list of elements on the diagonal
RotateLeft, RotateRight — cyclically rotate rows or columns
Reverse — reverse rows or columns
Transpose — interchange rows and columns
Join — join rows or columns of several matrices
UpperTriangularize ▪ LowerTriangularize
Position — find positions where elements that match a pattern occur
Extract — extract elements that appear at a list of positions
ReplacePart — make replacements for collections of elements
ArrayRules — get a list of positions and values for nonzero elements
Map — apply a function at any level
MapApply —apply a function to the rows of a matrix
Symbolic Matrices
Indexed — represent a symbolically indexed matrix