Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Technological Institute of the Philippines - Manila Course: MATH 022A

Math & Physics Department ONLINE LECTURE

Laboratory Activity No. 3

Matrix Operations

Name: Group 3 Section: CS11S1


Date Performed: April 4, 2022 Date Submitted: April 7, 2022
Instructor: Engr. Jan Brylle Bernabe
1. Objective(s):

1.1 To add and subtract matrices and multiply a matrix by a scalar.


1.2 To multiply two matrices.
1.3 To use the properties of matrix addition, scalar multiplication, and zero matrices.
1.4 To determine the inverse of a matrix (if it exists).

2. Intended Learning Outcomes (ILOs):

The students shall be able to:


2.1 Demonstrate scientific thinking and the ability to approach scientific resources intelligently.
2.2 Utilize MATLAB software in solving linear algebra problems related to their fields of
specialization.
2.3 Infer appropriate conclusions based upon the results of the activity.
2.4 Reflect on personal transformation along the T.I.P. graduate attributes, specifically, professional
competence and critical thinking skills.

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

An n x n matrix A is invertible (or nonsingular) if a n x n matrix B exist such that AB = BA = In

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.

Some properties of an invertible matrix are as follows:


1. (A-1)-1 = A
2. (Ak)-1 = (A-1)k
3. (cA)-1 = A-1/c for c not equal to zero
4. (AT)-1 = (A-1)T
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE

4. Procedure:

Activity 1. Determine the sum/difference of matrix A and matrix B if

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. Find the difference of the matrices, type on command window “A – B”.


Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE

Activity 2. Determine the scalar multiple of matrix A and scalar c if

−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

Activity 3. Determine the product of matrix D and matrix E if


7 4 9 8 7 3 8 2
3 1 −3] E = [3 −5] F = [6 G = [1
D =[ 5 4] 5 −4]
4 0 6
1 2 3 2 1 2 0 1

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 [ ]

4. Find the product of “E*D”

_
answer [ _ ]
_

5. Determine the product of “DTE” [ Transpose of matrix D in MATLAB is D apostrophe (D’) ]

answer ( copy the MATLAB answer )

Explain why DTE cannot be multiplied ?

Activity 4. Find the inverse of matrix G, type on command window “inv(G)” and “rats(inv(G))”

_
inv(G) = [ _ ] rats[inv(G)] = [ ]
_

What is the difference between the command “inv(G)” and “rats[inv(G)]” ?

Find the inverse of matrix F and why there is no inverse of matrix F?


Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE

Exercises

Use the following matrices to perform the following operations. Find

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 =

1.0000 0.0000 -0.0000


0 1.0000 0.0000
0 -0.0000 1.0000
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE

5. CD+ A–1 B–1


>>C*D + inv(A)*inv(B)

ans =

-10.1997 10.2207 -8.0773


-15.8879 22.8838 -9.8874
-18.8095 21.8254 -13.9365

6. Show that (AB)–1 = B–1 A–1


(AB)–1 =
>>inv(A*B)

ans =

-0.0819 -0.0824 0.1874


0.0584 -0.0538 0.0415
0.0456 0.0896 -0.1167

B–1 A–1 =
>>inv(B)*inv(A)

ans =

-0.0819 -0.0824 0.1874


0.0584 -0.0538 0.0415
0.0456 0.0896 -0.1167
Technological Institute of the Philippines - Manila Course: MATH 022A
Math & Physics Department ONLINE LECTURE

Conclusion

Copyright and Privacy

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.

You might also like