Next: A few examples
Up: Some xcas commands, with
Previous: Scalar commands
  Contents
Linear algebra.
Warning, in Mupad and Maple, you must activate the linalg package
commands by export(linalg) (Mupad) or with(linalg); (Maple).
- A[j,k]: element row j, column k of
the matrix A. xcas accepts also the C notation A[j][k]
- A+B/evalm(A&+B) or add(A,B) /A+B
(addition of matrices or vectors),
- 1/A/inverse(A)/both
(inverse of an invertible matrix A),
- A*B/evalm(A&*B) or multiply(A,B) /A*B
(multiplication of 2 matrices),
- f*A/scalarmul(A,f) / f*A
(multiplication of the matrix or vector A by the expression
f),
- charpoly(A,x)
(determinant of
xId - A (characteristic polynomial))
- det(A)
(determinant of a matrice A),
- eigenvalues(A)/eigenvals(A) / both
(eigenvalues of the matrix A. If you want numerical eigenvalues,
(assuming A has only numeric values), write at least one of the coefficient
of A as a real or complex number (with a .
, e.g. 5.0
instead
of 5).
- eigenvectors(A)/eigenvects(A)/both
(eigenvectors of A, see above if you want a numeric answer)
- A=B/equal(A,B)/both: equality testfor matrices
- matlinsolve(A,b)/linsolve(A,b)/linsolve(A,b)
(solve the linear equation Ax = b, A a matrix and b a vector)
- matrix() (create a matrix):
matrix(2,2,[[5,4],[6,3]])
f:=(j,k)->(1/(j+k-1));matrix(2,2,f)
Dom::Matrix()([[5,4],[6,3]])
/matrix([[5,4],[6,3]])//[[5,4],[6,3]],
- ncols(A)/coldim(A)/both
number of columns
- nrows(A)/rowdim(A)/both
number of lines
- scalarProduct(A,B)/dotprod(A,B)/both
(scalar product of the 2 vectors A and B),
- trace/tr/trace: trace of a matrix
- transpose(A) (transposed of A)
- Creating a vector : it's a
n×1 matrix (or maybe
a line matrix
1×n).
Examples :
matrix(3,1,[[1],[2],[3]])
Dom::Matrix()([1,2,3])
/vector([1,2,3])/[1,2,3].
To run a command on all component of a vector or a matrix, the map
command is used, e.g.
map(A,normal)
runs the normal
command on all components of A.
Next: A few examples
Up: Some xcas commands, with
Previous: Scalar commands
  Contents
giac documentation written by Bernard Parisse