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.

Functions

expand all

mldivideSolve systems of linear equations Ax = B for x
mrdivideSolve systems of linear equations xA = B for x
pagemldividePage-wise left matrix divide (Since R2022a)
pagemrdividePage-wise right matrix divide (Since R2022a)
decompositionMatrix decomposition for solving linear systems
lsqminnormMinimum norm least-squares solution to linear equation
pagelsqminnormPage-wise minimum-norm least-squares solution to linear equation (Since R2024a)
linsolveSolve linear system of equations
invMatrix inverse
pageinvPage-wise matrix inverse (Since R2022a)
pinvMoore-Penrose pseudoinverse
pagepinvPage-wise Moore-Penrose pseudoinverse (Since R2024a)
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
pageeigPage-wise eigenvalues and eigenvectors (Since R2023a)
eigsSubset of eigenvalues and eigenvectors
balanceDiagonal scaling to improve eigenvalue accuracy
svdSingular value decomposition
pagesvdPage-wise singular value decomposition (Since R2021b)
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
pagetransposePage-wise transpose (Since R2020b)
pagectransposePage-wise complex conjugate transpose (Since R2020b)
mtimesMatrix multiplication
pagemtimesPage-wise matrix multiplication (Since R2020b)
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
pagenormPage-wise matrix or vector norm (Since R2022b)
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

Topics

Featured Examples