Professional Documents
Culture Documents
Group 3 Laboratory 3 - Matrix Operations
Group 3 Laboratory 3 - Matrix Operations
Matrix Operations
3. Discussion:
Operations on matrices are doing matrix addition, scalar multiplication, and matrix multiplication. By
definition of matrix addition, if A = [𝑎ij] and B = [𝑏ij] are matrices of size 𝑚𝑥𝑘, then their sum is the
𝑚𝑥𝑘 matrix given by A + B = [𝑎ij + 𝑏ij]. For multiplication of real numbers on a matrix or also known
as scalar multiplication, if A = [𝑎ij] is an 𝑚𝑥𝑘 matrix and c is a scalar multiple of A by c is the 𝑚𝑥𝑘
matrix A given by cA = [𝑐𝑎ij]. However, for matrix multiplication, if A = [𝑎ij] is an 𝑚𝑥𝑘 matrix and
B = [𝑏ij] is an 𝑘𝑥𝑝 matrix, then the product 𝐴𝐵 is an 𝑚𝑥𝑝 matrix 𝐴𝐵 = [𝑐ij] where
[𝑐𝑎ij] = ∑𝑛 𝑎ik𝑏kj = 𝑎i1𝑏1j + 𝑎i2𝑏2j + 𝑎i3𝑏3j + … + 𝑎i𝑛𝑏𝑛j.
k=1
Where In is the identity matrix of order n. The matrix B is called the inverse of A. The inverse of a
matrix A is usually denoted by A-1.
4. Procedure:
1 0 3] and 𝐵 = [3 2 7]
𝐴= [
−5 8 4 1 −4 5
Procedure:
1. Open the MATLAB.
2. From the above matrices, type all the entries of A and B on the command window and name
them as matrix A and matrix B respectively.
3. Find the sum of the matrices, type on command window “A + B”.
(Note: Matrices should be of the same size otherwise the sum is undefined.)
−4 2 4
𝐷 = [ 3 2 −1] c=4
0 1 3
Procedure:
1. Open a new window command for the next example.
2. Enter all the elements of matrix D and scalar c, name the arrangement as matrix D and scalar c
respectively.
3. Find the scalar multiple, type on command window “c*D”.
(Note: dimension is not necessary to determine the scalar multiple of the matrix.)
In MATLAB
>> c = 4
>> c*D
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE
Procedure:
1. Open a new window command for the next exercise.
2. Enter all the elements of matrix D and matrix E.
(Note: The number of rows in one of the matrix should be equal to the numbers of columns on
another matrix.)
3. Determine the product of the two matrices, type on command window “D*E”.
answer [ ]
_
answer [ _ ]
_
Activity 4. Find the inverse of matrix G, type on command window “inv(G)” and “rats(inv(G))”
_
inv(G) = [ _ ] rats[inv(G)] = [ ]
_
Exercises
1. 2A + 3B
>>2*A + 3*B
ans =
24 2 19
12 11 22
1 8 14
2. 3C – DTp
>>3*C - D'
ans =
5 15
0 11
6 23
3. DB – CTA
>>D*B - C'*A
ans =
-16 5 -34
-26 -25 -7
4. A–1A
>>inv(A)*A
ans =
ans =
ans =
B–1 A–1 =
>>inv(B)*inv(A)
ans =
Conclusion
Property of the Technological Institute of the Philippines (T.I.P.). No part of the materials made
and uploaded in this learning management system by T.I.P. may be copied, photographed, printed,
reproduced, shared, transmitted, translated or reduced to any electronic medium or medium-
readable form, in whole or in part, without prior consent of T.I.P.