Function Reference

Linear Algebra

Basic Matrix Functions

balance
Compute `aa = dd \ a * dd' in which `aa' is a matrix whose row and column norms are roughly equal in magnitude, and `dd' = `p * d', in which `p' is a permutation matrix and `d' is a diagonal matrix of
cond
Compute the P-norm condition number of a matrix.
det
Compute the determinant of A using LAPACK for full and UMFPACK for sparse matrices.
dmult
Scale a matrix by rows or columns, or a multidimensional tensor along a specified dimension.
dot
Computes the dot product of two vectors.
eig
The eigenvalues (and eigenvectors) of a matrix are computed in a several step process which begins with a Hessenberg decomposition, followed by a Schur decomposition, from which the eigenvalues are ap
givens
Return a 2 by 2 orthogonal matrix `G = [C S; -S' C]' such that `G [X; Y] = [*; 0]' with X and Y scalars.
planerot
Given a two-element column vector, returns the 2 by 2 orthogonal matrix G such that `Y = G * X' and `Y(2) = 0'.
inv
Compute the inverse of the square matrix A.
matrix_type
Identify the matrix type or mark a matrix as a particular type.
norm
Compute the p-norm of the matrix A.
null
Return an orthonormal basis of the null space of A.
orth
Return an orthonormal basis of the range space of A.
pinv
Return the pseudoinverse of X.
rank
Compute the rank of A, using the singular value decomposition.
rcond
Compute the 1-norm estimate of the reciprocal condition as returned by LAPACK.
trace
Compute the trace of A, `sum (diag (A))'.
rref
Returns the reduced row echelon form of A.

Matrix Factorizations

chol
Compute the Cholesky factor, R, of the symmetric positive definite matrix A, where
cholinv
Use the Cholesky factorization to compute the inverse of the symmetric positive definite matrix A.
chol2inv
Invert a symmetric, positive definite square matrix from its Cholesky decomposition, U.
cholupdate
Update or downdate a Cholesky factorization.
hess
Compute the Hessenberg decomposition of the matrix A.
lu
Compute the LU decomposition of A.
qr
Compute the QR factorization of A, using standard LAPACK subroutines.
qrupdate
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of A + U*V', where U and V are column vectors (rank-1 update).
qrinsert
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of [A(:,1:j-1) x A(:,j:n)], where U is a column vector to be inserted into
qrdelete
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of [A(:,1:j-1) A(:,j+1:n)], i.
qz
Generalized eigenvalue problem A x = s B x, QZ decomposition.
qzhess
Compute the Hessenberg-triangular decomposition of the matrix pencil `(A, B)', returning `AA = Q * A * Z', `BB = Q * B * Z', with Q and Z orthogonal.
schur
The Schur decomposition is used to compute eigenvalues of a square matrix, and has applications in the solution of algebraic Riccati equations in control (see `are' and `dare').
subspace
Determine the largest principal angle between two subspaces spanned by columns of matrices A and B.
svd
Compute the singular value decomposition of A
housh
Compute Householder reflection vector HOUSV to reflect X to be the jth column of identity, i.
krylov
Construct an orthogonal basis U of block Krylov subspace

Functions of a Matrix

expm
Return the exponential of a matrix, defined as the infinite Taylor series
logm
Compute the matrix logarithm of the square matrix A.
sqrtm
Compute the matrix square root of the square matrix A.
kron
Form the kronecker product of two matrices, defined block by block as
syl
Solve the Sylvester equation