The standard operations for matrix algebra are:
MAT REM <text> / no operation, for comments etc.
MAT A / writes the internal name of matrix A and dimensions
MAT DIM A / writes the dimensions of matrix A on the same line
in the form / * rowA=20 colA=8
If A is diagonal, also rank of A (# of nonzero diagonal
elements) is given in the form rankA=5
MAT C=ZER(10,3) / null matrix 10*3
MAT C=IDN(10,10) / identity matrix 10*10
MAT C=IDN(10,10,0.3) / 0.3*IDN(10,10)
MAT C=CON(10,3) / 10*3 matrix with all elements =1
MAT C=CON(10,3,0.3) / 10*3 matrix with all elements =0.3
MAT C=TRI(10,10,0.3) / upper 10*10 triangular matrix with non-zero elements =0.3
MAT C=A / copies A to C
MAT C=A' / transpose of A
MAT C=A+B
MAT C=A-B
MAT C=A*B
MAT C=MMT(A) / C=A*A' MAT C=MMT2(A,B) / C=A*B'
MAT C=MTM(A) / C=A'*A MAT C=MTM2(A,B) / C=A'*B
MAT C=INV(A) / inverse of A
MAT C=INV(A,det) inverse and determinant of A
determinant is given in the form /* det=1.0045
See also MATSOLVE?
MAT C=DINV(A) / makes a 'generalized inverse' of a diagonal matrix A
by inverting the non-zero diagonal elements only.
See SING(ular value decomposition) and MPINV.
MAT C=DINV(A,eps) uses value eps as upper limit for 'zero'.
Default value for eps is 1e-15.
(Use MAT R=RANK(A) to see the rank.)
MAT TRACE A / trace of A in the form /* trA=30.7
MAT C=A^n / n'th power of a square matrix A (n integer>0)
MAT C=A^k / k'th power of a positive semidefinite A (k>0) or
positive definite A (k<>0)
For example, MAT C=A^0.5 gives square root of A.
MAT C=A^k / if A is a vector, C is vector of k'th powers of A elements.
MAT C=KRONECKER(A,B) / Kronecker product of A and B
MAT C=RANK(A) / C(1,1)=the rank of A (C is a 1x1 matrix)
MAT C=TRACE(A) / C is tr(A).
MAT C=DET(A) / C is the determinant of A.
MAT C=LDET(A) / C is the logarithm of DET(A).
MAT C=NULL(A) / C is an orthonormal basis of the null space of A.
See also MATSOLVE?
MAT C=BASIS(A) / C is an orthonormal basis of the column space of A.
See also MAXDET?
MAT C=MPINV(A) / C is the Moore-Penrose inverse of an m*n A. (MPINV?)
In RANK, NULL, BASIS, and MPINV the threshold for a singular value =0
is EPS*d_max (d_max=maximal singular value) where EPS can be given as
a specification. By default EPS=1e-15.
More about operations related generalized inverses etc. (See MPINV?)
Any matrix operand can also be given in transposed form.
For example,
MAT C=A+B'
MAT C=A'*B
MAT C=INV(SUMS')
MAT LOAD A'(1:5,*)
are permitted operations.
G = General matrix expressions
M = More information on MAT operations