Section 0. Setup and matrix entry.restart; with(LinearAlgebra): with(DEtools): with(plots):Section 1. Matrix entry.A:= <<-1|2|3>,<-3|-2|-1>>;
B:= <<1,0,-1>|<3,1,-2>>;
Section 2. Matrix operations.AdditionA+B;A+A;Matrix multiplication, powers, and inversionThe symbol for matrix multiplication in the LinearAlgebra package is a period (.), not an asterisk (*).A.A;M1:=A.B;M2:=B.A;A^3;M1^3;M3:=M1^(-1);M2^3;M2^(-1);A^(-1);Scalar multiplicationThe proper symbol for scalar multiplicat (scalar time matrix) is the asterisk. Using a period produces strange results: sometimes the result is undefined; sometimes the result seems to be defined but in fact is not (in Maple's view) a matrix!2*A;whattype(2*A);A*2;Equal(2*A,A*2);t*A;whattype(t*A);t.A;whattype(t.A);(2).A;whattype((2).A);
Equal((2).A,2*A);2.A;A.2;whattype(A.2);