XIII  Linear Algebra

FunctionsBrief Usage Descriptions
det,rank,norm
cnd,mno,cfm
dot,trace,cross
Calculate determinant, trace, rank, norm, dot product, minor, cofactor matrix, and condition number.
det(A)—determinant of A; trace(A)—trace of A; rank(A)—rank of A; cnd(A)—condition number of A; mno(A,i,j)—minor of ij-entry of A
norm(A)—2-norm; norm(A,1)—1-norm; norm(A,oo)—∞-norm; cfm(A)—cofactor matrix of A; dot(a,b)—dot product; cross(a,b)—cross product.
tsp,cjg,inv
chp,elf,rref
Matrix transpose, conjugate, inverse, and characteristic polynomial.
elf(A)—row echelon form of A; rref(A)—reduced row echelon form of A; chp(A)—characteristic polynomial of A; tsp(A)—AT or A*.
inv(A)—A-1 of A (square) and A+ the Moore-Penrose pseudoinverse of A (non-square matrix); cjg(A)—conjugate of A.
mrg,rdm,eye
jcb,rtm,diag
ones,zeros
Merge matrices. Special matrices, random matrices, Jacobian and rotation matrices.
mrg(A,B)—merges A and B by rows; mrg(A,B,1)—merges A and B by columns; jcb(F,v)—Jacobian matrix (F—vector-function, v—variables of F)
eye(3)—3 × 3 identity matrix; diag(a,b,c)—3 × 3 diagonal matrix; rtm(θ)—3 × 3 rotation matrix about x-axis; rtm(θ,2)—rotation about y-axis;
rtm(θ,3)—rotation about z-axis; rdm(m)—m × m random; rdm(m, n, type, seed, lower, upper)—m × n random with type, seed and entries within the lower and upper limits. Type indicators: 0—random, 1—diagonal, 2—upper triangular, 3—lower triangular, 4—symmetric, 5—Jordan cell (seed for eigenvalue).
rsp,nsp,eig
grs,dgl
Row space, null space, eigenvalues and eigenvectors, Gram-Schmidt orthogonalization process, and diagonalization.
rsp(A)—row space of A; nsp(A)—null space of A; grs(A)—orthogonal rows of A; grs(A,1)—orthonormal rows of A; 
dgl(A)—P, D such that D = P-1AP; dgl(A,1)—columns of P normalized; dgl(A,0,0)—P only (not normalized); dgl(A,0,1)—D only.
eig(A)—eigenvalues and eigenvectors of A.
qrd,lud,cho
svd,ldl,rkd
jcf
Matrix decomposition.
qrd(A)—Q, R and A = QR; lud(A)—L, U and A = LU; cho(A)—L and A = LL*; svd(A)—U, Σ, V and A = UΣV;
ldl(A)—L, D and A = LDL*; rkd(A)—C, F and A = CF; jcf(A)—P, J and A = PJP-1.
tof Determine if a matrix has a certain property and return True or False. There are seven options indicated from 0 to 6, and the default is 1.
tof(A)—positive definite; tof(A,0)—diagonalizable; tof(A,1)—positive definite (default); tof(A,2)—negative definite; tof(A,3)—positive semidefinite; tof(A,4)—negative semidefinite; tof(A,5)—indefinite; tof(A,6)—nilpotent.