0% found this document useful (0 votes)
96 views7 pages

Ce21s5 - Tenorio - Matlab Activity - 4-2

The document provides MATLAB syntax and output for calculating determinants and solving other problems using matrices. It includes: 1. Using the det() function to find determinants of 4 matrices (A-D). 2. Using Cramer's Rule and det() to solve a system of equations. 3. Using det() to find the volume of a figure. 4. Using det() to calculate the total area of a lot given the vertices of the lot.

Uploaded by

ernest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views7 pages

Ce21s5 - Tenorio - Matlab Activity - 4-2

The document provides MATLAB syntax and output for calculating determinants and solving other problems using matrices. It includes: 1. Using the det() function to find determinants of 4 matrices (A-D). 2. Using Cramer's Rule and det() to solve a system of equations. 3. Using det() to find the volume of a figure. 4. Using det() to calculate the total area of a lot given the vertices of the lot.

Uploaded by

ernest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

NAME : TENORIO, ANDREA NICOLE Section: CE21S5

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. ( 3 points each)

Given MATLAB Syntax MATLAB Out put Determinan


t of
−1 1 1 A=[-1 1 1;-1 -1 1;1 1 A = Matrix A
-1]
1. A = −1 −1 1
1 1 −1 -1 1 1
-1 -1 1
0
det(A) 1 1 -1

ans =

7 6 5 4 A= Matrix A
A=[7 6 5 4;6 5 4 3;5 4
6 5 4 3
2. A= 3 2;4 3 2 1] 7 6 5 4
5 4 3 2 6 5 4 3
4 3 2 1 5 4 3 2 0
4 3 2 1
det(A)
ans =

3. If is A=[1 2 0;3 4 0;0 0 5] Matrix B


1 2 0 A =
A = 3 4 0 cre
0 0 5 I=eye(3) 1 2
648
ate a matrix B 0
whose entries are 3 4
three times the 0
difference of an B=3*(I-A) 0 0
identity matrix of 5
order 3 and matrix
I =
A.
det(B)
1 0
0
0 1
0
0 0
1
B =

0 -6
0
-9 -9
0
0 0
-12
ans =

648

4. Create matrix C if A=[1 2;3 4] A = Matrix C


possible .
Use
1 2
C = 5 * eye(size ( A) − C=5*(eye(2)-A)^2
A)^2
3 4
1 2 900
, where A =   C =
3 4
30 30
det (C)
45 75

ans =

900

5. D = transpose ( A) * A A=[0 1 1;0 1 0;1 0 1] A = Matrix D


, where
0 1 1  0 1
A = 0 1 0 D=A'*A 1
1
1 0 1 0 1
0
1 0
1
D =
det(D)

1 0
1
0 2
1
1 1
2
ans =

B. Use MATLAB SYNTAX solve the given problems below. Write the MATLAB syntax you use and the MATLAB
output in the space provided. ( 5 points each)

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

MATLAB Syntax MATLAB Output


A=[7/18 5/9; 8 12]; x =
B=[-1;-24]; r=det(R);
R1=[-1 5/9; -24 12];
x=det(R1)/det(R) 6
R2=[7/18 -1; 8 -24];
y=det(R2)/det(R)
y =

-6

Solution Set: {6, -6}

2. Find the volume of the given figure


MATLAB Syntax MATLAB Output

A=[60 0 0 1; 0 60 0 1; 0 0 60 1; 0 0 0 1]; A =
A=1/6*det(A)
36000

Volume: 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?

MATLAB Syntax MATLAB Output


A =

A=[0 -2 1;10 -2 1;0 4 1]


0 -2 1
10 -2 1
0 4 1
B=[0 4 1;20 4 1;10 -2 1]
B =

0 4 1
20 4 1
10 -2 1

1/2*(det(A)) ans =

30
-1/2*(det(B)) ans =
60
ans =
[1/2*(det(A))+(-1/2*(det(B)))]

90

Total Area: 90 square unit

Command History
Honor Pledge:

“I affirm that I shall not give or receive any unauthorized help on this assignment and that all work is my own”

You might also like