MATLAB ACTIVITY 4 - Determinant Using MATLAB
MATLAB ACTIVITY 4 - Determinant Using MATLAB
A. Use the det( ) built-in function to find the determinants of the following matrices. Write the MATLAB SYNTAX
you used and MATLAB out put on the space provided
−1 1 1
A=|−1 −1 1 |
1. 1 1 −1 det A = 0
Output: A =
-1 1 1
-1 -1 1
1 1 -1
Syntax: A_ans=det(A)
Output: A_ans =
7 6 5 4
6 5 4 3
A=| |
5 4 3 2
2. 4 3 2 1 det A = 0
Output: A =
7 6 5 4
6 5 4 3
5 4 3 2
4 3 2 1
Syntax: >> A_ans=det(A)
Output: A_ans =
1 2 0
3. If is
A= 3 4 0
0 0 5[ ] create a matrix B whose entries are three times the difference of an identity matrix of
order 3 and matrix A. What are the entries in B and its determinant?
0 -6 0
-9 -9 0
0 0 -12
Output: B_ans =
648
0 −6 0 1 1 1
Therefore B= −9 −9
0 [ ]
0 while the determinant of B=648. 1 −1 4
0 −12 2 3 −5 [ ]
A= 1 2
4.
^
Create matrix C if possible . Use C=5∗eye( size( A )− A ) 2 , where
[ ]
3 4 then matrix is C=
_____________ and determinant of C=_____
>> D=transpose(A)*A
Output: D =
1 0 1
0 2 1
1 1 2
Output: D_ans =
1 0 1
Therefore D=
[ ]
0 2 1 while the determinant of D=1.
1 1 2
B. Use MATLAB SYNTAX solve the given problems below. Write the MATLAB syntax you use and the MATLAB
output in the space provided.
8x + 12y = -24
7 5
x + y=−1
18 9
Output: Cramer_ans =
-0.2222
Output: x =
6.0000
Output: y =
-6.0000
1
Volume=± det
6
Output: Tetravol =
36000
Therefore, the volume of the given tetrahedron is equal to 36,000 cubic unit.
3. Mr. Cruz would like to buy a lot however, his broker gave the dimension of the lot using the vertices (0, 4), (0,-2) (20, 4) and
(10, -2). What would be the total area of the lot that Mr. Cruz will be buying?
0 -2 1
10 -2 1
0 4 1
Output: ans =
30
Output:>> L2 =
0 4 1
20 4 1
10 -2 1
60
Syntax:>>[1/2*(det(L1))+(-1/2*det(L2))]
Output:ans =
90
Therefore, the total area of lot that Mr. Cruz will buy will be 90 square meters.
“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”