Operations with Matrices
Maple contains two linear algebra packages, LinearAlgebra and linalg. The former is the later package. Each will be illustrated below.
| > | restart: |
| > | with(LinearAlgebra): |
Every command in the LinearAlgebra package begins with a capital letter.
| > | A:=Matrix([[1,2,3],[4,5,6],[7,8,9]]); |
| > | B:=Matrix([[2,4,6],[8,1,3],[5,7,9]]); |
| > | Determinant(A); |
| > | Determinant(B); |
| > | A+B; |
| > | Multiply(A,B); |
| > | restart: |
| > | with(linalg): |
Warning, the protected names norm and trace have been redefined and unprotected
| > | A:=matrix(3,3,[1,2,3,4,5,6,7,8,9]); |
| > | B:=matrix([[2,4,6],[8,1,3],[5,7,9]]); |
Either method can be used to enter matrices.
| > | det(A); |
| > | det(B); |
| > | matadd(A,B); |
| > | multiply(A,B); |
| > | evalm(A&*B); |
| > |