Main Content

Linear Algebra

Linear equations, eigenvalues, singular values, decomposition, matrix operations, matrix structure

Linear algebra functions in MATLAB® provide fast, numerically robust matrix calculations. Capabilities include a variety of matrix factorizations, linear equation solving, computation of eigenvalues or singular values, and more. For an introduction, see Matrices in the MATLAB Environment.

To speed up computations for a stack of matrices, especially for a large set of comparatively small matrices, use page-wise matrix functions. See Page-Wise Matrix Functions for more information.

Functions

expand all

mldivideSolve systems of linear equations Ax = B for x
mrdivideSolve systems of linear equations xA = B for x
decompositionMatrix decomposition for solving linear systems
lsqminnormMinimum norm least-squares solution to linear equation
linsolveSolve linear system of equations
invMatrix inverse
pinvMoore-Penrose pseudoinverse
lscovLeast-squares solution in presence of known covariance
lsqnonnegSolve nonnegative linear least-squares problem
sylvesterSolve Sylvester equation AX + XB = C for X
eigEigenvalues and eigenvectors
eigsSubset of eigenvalues and eigenvectors
balanceDiagonal scaling to improve eigenvalue accuracy
svdSingular value decomposition
svdsSubset of singular values and vectors
svdsketchCompute SVD of low-rank matrix sketch (Since R2020b)
svdappendRevise SVD after appending data (Since R2023b)
gsvdGeneralized singular value decomposition
ordeigEigenvalues of quasitriangular matrices
ordqzReorder eigenvalues in QZ factorization
ordschurReorder eigenvalues in Schur factorization
polyeigPolynomial eigenvalue problem
qzGeneralized Schur (QZ) factorization for generalized eigenvalues
hessHessenberg form of matrix
schurSchur decomposition
rsf2csfConvert real Schur form to complex Schur form
cdf2rdfConvert complex diagonal form to real block diagonal form
luLU matrix factorization
ldlBlock LDL' factorization for Hermitian indefinite matrices
cholCholesky factorization
cholupdateRank 1 update to Cholesky factorization
qrQR decomposition
qrdeleteRemove column or row from QR factorization
qrinsertInsert column or row into QR factorization
qrupdateRank 1 update to QR factorization
planerotGivens plane rotation
transposeTranspose vector or matrix
ctransposeComplex conjugate transpose
mtimesMatrix multiplication
mpowerMatrix power
sqrtmMatrix square root
expmMatrix exponential
expmvMatrix exponential multiplied by vector (Since R2023b)
logmMatrix logarithm
funmEvaluate general matrix function
kronKronecker tensor product
crossCross product
dotDot product
bandwidthLower and upper matrix bandwidth
trilLower triangular part of matrix
triuUpper triangular part of matrix
isbandedDetermine if matrix is within specified bandwidth
isdiagDetermine if matrix is diagonal
ishermitianDetermine if matrix is Hermitian or skew-Hermitian
issymmetricDetermine if matrix is symmetric or skew-symmetric
istrilDetermine if matrix is lower triangular
istriuDetermine if matrix is upper triangular
normVector and matrix norms
normest2-norm estimate
vecnormVector-wise norm
condCondition number for inversion
condest1-norm condition number estimate
rcondReciprocal condition number
condeigCondition number with respect to eigenvalues
detMatrix determinant
nullNull space of matrix
orthOrthonormal basis for range of matrix
rankRank of matrix
rrefReduced row echelon form (Gauss-Jordan elimination)
traceSum of diagonal elements
subspaceAngle between two subspaces
pagemldividePage-wise left matrix divide (Since R2022a)
pagemrdividePage-wise right matrix divide (Since R2022a)
pagelsqminnormPage-wise minimum-norm least-squares solution to linear equation (Since R2024a)
pageinvPage-wise matrix inverse (Since R2022a)
pagepinvPage-wise Moore-Penrose pseudoinverse (Since R2024a)
pageeigPage-wise eigenvalues and eigenvectors (Since R2023a)
pagesvdPage-wise singular value decomposition (Since R2021b)
pagemtimesPage-wise matrix multiplication (Since R2020b)
pagetransposePage-wise transpose (Since R2020b)
pagectransposePage-wise complex conjugate transpose (Since R2020b)
pagenormPage-wise matrix or vector norm (Since R2022b)

Topics

Featured Examples