102 CHAPTER 10. MATRIX
✞
1(%i1) A:matrix([1,2,3],[2,1,3],[4,7,4]);
(%i2) B:matrix([1,2,3],[2,1,3],[4,7,4]);
3(%i3) A+B;
✆
(%o3)
2 4 6
4 2 6
8 14 8
10.1.3 Scalar Subtraction of Matrices (-)
The operator-subtract two matrices element by element wise. IfA=Pijand
B=Qijare two matrices then the subtraction of matrixBfromAwill be
Cij=A−B=Pij−Qij
In subtraction of matrixBfrom matrixA, corresponding elements are sub-
tracted with each other and result is a matrix. Subtraction operation is per-
formed only if two matrices are of same order.
✞
1(%i1) A:matrix([2,2,3],[2,4,3],[4,7,4]);
(%i2) B:matrix([1,2,3],[2,1,3],[4,7,4]);
3(%i3) A-B;
✆
(%o3)
1 0 0
0 3 0
0 0 0
10.1.4 Scalar Multiplication of Matrices (*)
The operator*multiply two matrices element by element wise. IfA=Pijand
B=Qijare two matrices then the multiplication of matrixBtoAwill be
Cij=A∗B=Pij∗Qij
In scalar multiplication of matrixBto matrixA, corresponding elements are
multiply with each other and result is a matrix. Multiplication operation is
performed only if two matrices are of same order.
✞
1(%i1) A:matrix([2,2,3],[2,4,3],[4,7,4]);
(%i2) B:matrix([1,2,3],[2,1,3],[4,7,4]);
3(%i3) A*B;
✆