Linear Algebra
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, seeMatrices in the MATLAB Environment.
Functions
Linear Equations
mldivide |
Solve systems of linear equationsAx = Bforx |
mrdivide |
Solve systems of linear equationsxA = Bforx |
pagemldivide |
Page-wise left matrix divide |
pagemrdivide |
Page-wise right matrix divide |
decomposition |
Matrix decomposition for solving linear systems |
lsqminnorm |
Minimum norm least-squares solution to linear equation |
linsolve |
Solve linear system of equations |
inv |
Matrix inverse |
pageinv |
Page-wise matrix inverse |
pinv |
Moore-Penrose pseudoinverse |
lscov |
Least-squares solution in presence of known covariance |
lsqnonneg |
Solve nonnegative linear least-squares problem |
sylvester |
Solve Sylvester equationAX + XB = CforX |
Eigenvalues and Singular Values
eig |
Eigenvalues and eigenvectors |
eigs |
的特征子集values and eigenvectors |
balance |
Diagonal scaling to improve eigenvalue accuracy |
svd |
Singular value decomposition |
pagesvd |
Page-wise singular value decomposition |
圣言会 |
Subset of singular values and vectors |
圣言会ketch |
Compute SVD of low-rank matrix sketch |
gsvd |
Generalized singular value decomposition |
ordeig |
Eigenvalues of quasitriangular matrices |
ordqz |
Reorder eigenvalues in QZ factorization |
ordschur |
Reorder eigenvalues in Schur factorization |
polyeig |
Polynomial eigenvalue problem |
qz |
求出广义特征值分解 |
hess |
海塞nberg form of matrix |
schur |
Schur decomposition |
rsf2csf |
Convert real Schur form to complex Schur form |
cdf2rdf |
Convert complex diagonal form to real block diagonal form |
Matrix Decomposition
lu |
LU matrix factorization |
ldl |
Block LDL' factorization for Hermitian indefinite matrices |
chol |
Cholesky factorization |
cholupdate |
Rank 1 update to Cholesky factorization |
qr |
QR decomposition |
qrdelete |
Remove column or row from QR factorization |
qrinsert |
Insert column or row into QR factorization |
qrupdate |
Rank 1 update to QR factorization |
planerot |
Givens plane rotation |
Matrix Operations
transpose |
Transpose vector or matrix |
ctranspose |
Complex conjugate transpose |
pagetranspose |
Page-wise transpose |
pagectranspose |
Page-wise complex conjugate transpose |
mtimes |
Matrix multiplication |
pagemtimes |
Page-wise matrix multiplication |
mpower |
Matrix power |
sqrtm |
Matrix square root |
expm |
Matrix exponential |
logm |
Matrix logarithm |
funm |
Evaluate general matrix function |
kron |
Kronecker tensor product |
cross |
Cross product |
dot |
Dot product |
Matrix Structure
bandwidth |
Lower and upper matrix bandwidth |
tril |
Lower triangular part of matrix |
triu |
Upper triangular part of matrix |
isbanded |
Determine if matrix is within specific bandwidth |
isdiag |
Determine if matrix is diagonal |
ishermitian |
Determine if matrix is Hermitian or skew-Hermitian |
issymmetric |
Determine if matrix is symmetric or skew-symmetric |
istril |
Determine if matrix is lower triangular |
istriu |
Determine if matrix is upper triangular |
Matrix Properties
norm |
Vector and matrix norms |
normest |
2-norm estimate |
vecnorm |
Vector-wise norm |
cond |
Condition number for inversion |
condest |
1-norm condition number estimate |
rcond |
Reciprocal condition number |
condeig |
Condition number with respect to eigenvalues |
det |
Matrix determinant |
null |
Null space of matrix |
orth |
Orthonormal basis for range of matrix |
rank |
Rank of matrix |
rref |
Reduced row echelon form (Gauss-Jordan elimination) |
trace |
Sum of diagonal elements |
subspace |
Angle between two subspaces |
Topics
- Matrices in the MATLAB Environment
Matrix creation and basic operations.
- Systems of Linear Equations
Solve several types of systems of linear equations.
- Eigenvalues
Eigenvalue and eigenvector computation.
- Singular Values
Singular value decomposition (SVD).
- Factorizations
Common matrix factorizations (Cholesky, LU, QR).
- Matrix Exponentials
This example shows three of the 19 ways to compute the exponential of a matrix.
- Determine Whether Matrix Is Symmetric Positive Definite
This topic explains how to use the
chol
andeig
functions to determine whether a matrix is symmetric positive definite (a symmetric matrix with all positive eigenvalues). - 在MATLAB LAPACK
LAPACK provides a foundation of routines for linear algebra functions and matrix computations in MATLAB.
Featured Examples
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)