Maple Commands for Matrix Theory

The following is a list of Maple's commands that might be useful in Math 221, Matrix Theory. The commands are listed according to the chapter in the text where the ideas are first introduced. Of course, you should know how to do the computations by hand, and only use Maple to "help" you compute. All commands must be followed by a semi-colon or a colon. To use linear algebra commands enter with(linalg): to first load the linear algebra package. A more complete description of the command and its options can be found using Maple's Help and then Topic Search... You'll find that most of Maple's commands "make sense" in that they are named according to what they do.

Chapter 1

+, -, *, /, ^ - standard operations
&* - matrix multiplication
LUdecomp(A,P='P',L='L',U='U') - compute the LU decomposition of the matrix A
augment(A,b) - join the matrices A and b together horizontally
backsub(U,c) - back substitution on the (upper) triangular system Ux=c
band([list],n) - create a banded matrix of size nxn with band entries in list
det(A) - compute the determinant of the matrix A
diag(B1,B2,..,Bn) - create a block diagonal matrix with blocks (matrices) B1,B2,..,Bn along the diagonal
evalm(l) - display the matrix l
forwardsub(L,c) - forward substitution on the (lower) triangular system Lx=c
gausselim(A) - do Gauss elimination on the matrix A
gaussjord(A) - do Gauss-Jordan elimination on the matrix A
geneqns(A,x) - generate the equations from the coefficient matrix A and vector x
genmatrix(eqns,vars) - generate the coefficient matrix from a system of equations eqns with variables var
inverse(A) - compute the inverse of the matrix A
linsolve(A,b) - compute the solution of the system Ax=b
matadd(A,B) - add the matrices A and B
matrix(m,n,[list]) - create a mxn matrix with entries in list
matrix([[list_1],[list_2],...[list_m],) - create a matrix with row k listed by the entries in list_k
multiply(A,B) - matrix multiply the matrices A and B - can also use A&*B
norm(v,2) - compute the Euclidean norm (2-norm) of the vector v
normalize(v) - normalizes the vector v with Euclidean norm (2-norm)
pivot(A,i,j) - pivot about the (i,j) posistion of the matrix A
plot([[list]) - plots the data pairs contained in list
plot([formula,t=-1..2) - plots the formula defined by formula on the interval [-1,2]
rank(A) - compute the rank of the matrix A
scalarmul(A,expr) - multiply the matrix A by the scalar expr
stackmatrix(v) - converts v to a matrix
subs(_t[1]=p, _t[2]=3, evalm(y)) - in y substitutes p for t1, 3 for t2
toeplitz([list]) - create a symmetric Toeplitz matrix with first row the components in list
trace(A) - compute the trace of the matrix A
transpose(A) - compute the transpose of the matrix A
vector([list]) - create a vector with components in list
vector(n,i->v[i]^2) - create a vector of length n with components the squares of the components in vector v


Chapter 2

GramSchmidt([v1,v2,..,vn]) - compute orthogonal vectors {w1,w2,..,wn} by doing Gram Schmidt on {v1,v2,..,vn}
QRdecomp(A,Q='Q',fullspan=false) - compute the QR factorization of the matrix A
basis({v1,v2,..,vn}) - return a basis for the vector space spanned by {v1,v2,..,vn} in terms of the original vectors
col(A,i..k) - extract columns i through k of the matrix A as column vectors
colspace(A) - compute a basis for the column space of the matrix A
colspan(A) - compute a set of vectors that span the column space of the matrix A
leastsqrs(A,b) - compute the least squares solution of the system Ax=b
nullspace(A) - compute a basis for the nullspace of the matrix A
orthog(A) - test if the (square) matrix A is orthogonal
rowspace(A) - compute a basis for the row space of the matrix A
rowspan(A) - compute a set of vectors that span the row space of the matrix A


Chapter 3

charpoly(A,lambda) - compute the characteristic polynomial det(lambda*I-A)
eigenvalues(A) - symbolically compute the eigenvalues of the square matrix A
Eigenvalues(A) - numerically compute the eigenvalues of the square matrix A
eigenvects(A) - compute the eigenvalues, eigenvectors, and multiplicities of the square matrix A
issimilar(A,B) - determine if the two matrices A and B are similar
Svd(A,U,V) - compute the singular value decomposition of A