dot(a,b)
|
Takes two vectors and computes the dot product.
The a and b vectors must be the same
size. Takes two 1D arrays as arguments and returns a scalar real value. |
cross(a,b)
|
Takes two vectors with three elements each and
computes the cross product (also a vector with three elements). Takes
two 1D arrays as arguments and returns a 1D array. Cross product is available
only for 1D arrays with exactly three elements. |
prod(A,B)
|
Takes two matrices and returns the product (also
a matrix). Takes two 2D arrays as arguments and returns a 2D array. |
transpose(A)
|
Computes the transpose of a matrix/vector. Takes
a 2D array as an argument and returns a 2D array. |
inv(A)
|
Computes the inverse of the square matrix A .
Takes a square 2D array as an argument and returns a 2D array. |
powerm(A,n)
|
Computes the power of a matrix A
using eigen value decomposition. Takes a 2D array and a scalar as arguments
and returns a 2D array. |
det(A)
|
Computes the determinant of a matrix. Takes
a square 2D array as an argument and returns a scalar real value. |
rank(A)
|
Computes the rank of a matrix A (i.e., the number
of linearly independent rows). |
norminf(A)
|
Calculates the L-infinity norm (or maximum row
sum norm) of a matrix A . Takes a 1D or 2D array as an
argument and returns a scalar real value.
|
norm1(A)
|
Calculates the L1 norm (or maximum column sum
norm) of the matrix or vector A . Takes a 1D or 2D array
as an argument and returns a scalar real value.
|
norm2(A)
|
Calculates the L2 norm (or spectral norm) of
the matrix or vector A . Takes a 1D or 2D array as an
argument and returns a scalar real value
(i.e., is an eigen value of ATA). |
trace(A)
|
Computes the trace (i.e., the sum of values
along the main diagonal). Takes a 2D array as an argument and returns
a scalar real value. |
eig(A)
|
Computes the set of real eigen values of a square
matrix. Takes a square 2D array as an argument and returns a 1D array. |
Decompositions |
|
chol(A)
|
Computes the Cholesky decomposition (i.e.,
LLT = A) of a positive definite matrix.
Takes a square 2D array as an argument and returns a 2D array. |
lu(A)
|
Computes the LU decomposition of A .
Takes a 2D array as an argument and returns an aggregate containing two
2D arrays (L&U) and an integer array (pivot). |
singularValues(A)
|
Computes the singular value and returns the
S matrix. Takes a 2D array as an argument and returns a 2D array. |
Matrix Assignments |
|
A=ones(m,n)
|
Creates a matrix with 1 at all locations. Takes
two integers as arguments and returns a 2D array. |
A=zeros(m,n)
|
Creates an m by n
zero matrix. Takes two integers as arguments and returns a 2D array. |
A=identity(n)
|
Creates an n by n
identity matrix. Takes an integer as an argument and returns a 2D array. |