Matrices: Ece120L - Introduction To Matlab Laboratory Activity #2
Matrices: Ece120L - Introduction To Matlab Laboratory Activity #2
LABORATORY ACTIVITY #2
MATRICES
I. Learning Outcomes:
1. At the end of the laboratory activity, the students should be able to:
2. Use MATLAB in creating and manipulating matrices.
3. Solve linear systems of equation using MATLAB
B. MATLAB codes:
2. A. Problem:
If A = magic (24), what is the value in row 21, column 22?
B. MATLAB codes:
3. A. Problem:
Create the matrix X = diag ([3:3:15]).
B. MATLAB codes:
4. A. Problem:
Using magic square of 5, write the values in lower triangular.
B. MATLAB codes:
5. A. Problem:
Using magic square of 4, write the values in upper triangular.
B. MATLAB codes:
6. A. Problem:
Determine the determinant of the matrix.
1 3 6
[ −2 5 9
7 −2 23 ]
B. MATLAB codes:
7. A. Problem:
Determine the determinant and coefficients w, x, y, z
Given: w – 12x +13y – 7z = 23
2w + 15x + 16y + 12z = 19
4w – 10x + y + 17z = 24
3w + 2x – 3y + 2z = 14
B. MATLAB codes:
8. A. Problem:
Define the matrices below: (use shortcuts if applicable)
1 2 3 4 1 1 1 1 16 2 3 13 1 0 0 0 1 0 0 0 3 6 9 12
1 5 11 10 8 18 24 3 15
6 8 1 5 1 1 1 0 3 0 0 0 1 0 0
A B C D E F
9 4 2 7 1 1 1 1 9 7 6 12 0 0 5 0 0 0 0 1 27 12 6 21
9 4 7 2 1 1 1 1 4 14 15 1 0 0 0 7 1 0 0 0 27 12 21 6
B. MATLAB codes:
9. A. Problem:
Using the matrices of #8, solve the following:
a. 3A+4F
b. ABC/4F
c. 2DEF+4B
d. FEB/2CD
e. (2B – 3D)(2ABC)
B. MATLAB codes:
10. A. Problem:
Create the matrix below using the matrices of #8.
1 2 3 4 2 2 2 2 4 3 3 3
6 8 1 5 2 2 2 2 3 4 3 3
9 4 2 7 2 2 2 2 3 3 3 4
9 4 7 2 2 2 2 2 4 3 3 3
1 4 7 10 16 2 3 13 1 0 0 0
16 22 1 13 5 11 10 8 0 3 0 0
25 10 4 19 9 7 6 12 0 0 5 0
25 10 19 4 4 14 15 1 0 0 0 7
B. MATLAB codes: