Linear Algebra
Matrix decompositions, solvers, products, norms, and other linear algebra operations.
eig
Eigenvalues and eigenvectors
D = eig(A)
eigh
Eigenvalues and eigenvectors of symmetric matrix
D = eigh(A)
eigvalsh
Eigenvalues of symmetric matrix
D = eigvalsh(A)
svd
Singular value decomposition
S = svd(A)
qr
QR decomposition
R = qr(A)
lu
LU decomposition with partial pivoting
L = lu(A)
chol
Cholesky factorization
R = chol(A)
det
Matrix determinant
d = det(A)
inv
Matrix inverse
B = inv(A)
pinv
Moore-Penrose pseudo-inverse
B = pinv(A)
rank
Matrix rank
r = rank(A)
trace
Sum of diagonal elements
t = trace(A)
norm
Matrix or vector norm
n = norm(A)
cond
Condition number
c = cond(A)
lstsq
Least-squares solution to linear equation
x = lstsq(A, b)
linsolve
Solve linear system Ax = b
x = linsolve(A, b)
mldivide
Matrix left division (A\b)
x = mldivide(A, b)
matmul
Matrix multiplication
C = matmul(A, B)
dot
Dot product
c = dot(a, b)
cross
Cross product
c = cross(a, b)
kron
Kronecker tensor product
K = kron(A, B)
outer
Outer product
C = outer(a, b)
einsum
Einstein summation convention
C = einsum(subscripts, A, B, ...)
mpower
Matrix power
B = mpower(A, n)