You are on page 1of 7

MARLON JOHN B ALINDOGAN EE12S3

NAME : _________________________ Section: _____________________

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
1. A  1 1 1 det A = ____________
1 1 1

MATLAB SYNTAX MATLAB OUTPUT


A=[-1 1 1 ; -1 -1 1 ; 1 1 -1]

det(A)

7 6 5 4
6 5 4 3
2. A det A = ____________
5 4 3 2
4 3 2 1

MATLAB SYNTAX MATLAB OUTPUT


A=[7 6 5 4 ; 6 5 4 3 ; 5 4 3 2 ; 4 3 2 1]

det(A)

1 2 0 
3.
 
If is A  3 4 0 create a matrix B whose entries are three times the difference of an identity matrix of
 
0 0 5
order 3 and matrix A. What are the entries in B and its determinant? B=_______________

determinant of B____
MATLAB SYNTAX MATLAB OUTPUT
A=[1 2 0 ; 3 4 0 ; 0 0 5]

I=[ 1 0 0 ; 0 1 0 ; 0 0 1]

B=3*(I-A)

det(B)

1 2
4. Create matrix C if possible . Use C  5 * eye(size( A)  A)^2 , where A    then matrix is C=
3 4
_____________ and determinant of C=_____

MATLAB SYNTAX MATLAB OUTPUT


A=[1 2 ; 3 4]

C= 5*eye.*(size(A)-A)^2

det(C)

0 1 1 
 
5. D  transpose( A) * A , where A  0 1 0 then D= _____________ and determinant of D=_____
1 0 1

MATLAB SYNTAX MATLAB OUTPUT


A=[0 1 1 ; 0 1 0 ; 1 0 1 ]

A^-1
D=transpose(A)*A

det(D)

B. Use MATLAB SYNTAX solve the given problems below. Write the MATLAB syntax you use and the MATLAB
output in the space provided.

1. Use Cramer’s Rule to show the solution of

MATLAB SYNTAX MATLAB OUTPUT


A=[-8 -12 ; 7/18 5/9 ]

det(A)

B=[24 ; -1]

A1=[24 -12 ; -1 5/9]

det(A1)
A2=[-8 24 ; 7/18 -1 ]

det(A2)
x= det(A1)/det(A)
y=det(A2)/det(A)

2. Find the volume of the given figure


MATLAB SYNTAX MATLAB OUTPUT
A=[60 0 0]

B=[0 60 0]

C=[0 0 60]

D=[0 0 0]

[A 1;B 1;C 1;D 1]

V=1/6.*(det([A 1 ; B 1 ; C 1 ; D 1]))

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?

MATLAB SYNTAX MATLAB OUTPUT


S= (10+20)*(4+2)/2 S= 90

You might also like