0% found this document useful (0 votes)
586 views

MATLAB ACTIVITY 4 - Determinant Using MATLAB: NAME: Gulla, Josiah Noel D. Section: CE21S2

The document contains a student's MATLAB activity worksheet. It includes 5 problems calculating determinants of matrices using the det() function and solving a system of 3 linear equations using Cramer's Rule. For each problem, the student provides the MATLAB syntax used and output. All matrix determinants are found to be 0 except the last one, which is 1. The solution to the system of equations is found to be x1=14/13, x2=10/13, x3=-7/13.

Uploaded by

Jay Umali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
586 views

MATLAB ACTIVITY 4 - Determinant Using MATLAB: NAME: Gulla, Josiah Noel D. Section: CE21S2

The document contains a student's MATLAB activity worksheet. It includes 5 problems calculating determinants of matrices using the det() function and solving a system of 3 linear equations using Cramer's Rule. For each problem, the student provides the MATLAB syntax used and output. All matrix determinants are found to be 0 except the last one, which is 1. The solution to the system of equations is found to be x1=14/13, x2=10/13, x3=-7/13.

Uploaded by

Jay Umali
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

NAME : Gulla, Josiah Noel D. Section: CE21S2 .

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 = ____________

MATLAB SYNTAX MATLAB OUTPUT


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

-1 1 1

-1 -1 1

1 1 -1

det(A) ans =

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

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

7 6 5 4

6 5 4 3

5 4 3 2

4 3 2 1

det(A) ans =

1 2 0

3.
B=3 (eye (¿( A¿)− A))
, where
B=Unrecognized function or variable 'B'
[ ]
A= 3 4 0
0 0 5 B= Matrix dimensions must agree. and det

A=[1 2 0; 3 4 0; 0 0 5] A=

1 2 0

3 4 0

0 0 5

B=3*(eye(size(A)-A)) Matrix dimensions must agree.

det(B) Unrecognized function or variable 'B'.


A= 1 2
4.
C=5(eye( ¿(A ¿)− A))2
, where
[ ]
3 4 C= Error using eye N-dimensional arrays are not supported. and
det C=Unrecognized function or variable 'C'.

MATLAB SYNTAX MATLAB OUTPUT


A=[ 1 2; 3 4] A =1 2

3 4

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

N-dimensional arrays are not supported.

det(C) Unrecognized function or variable 'C'.

0 1 1

5.
D= A AT

, where
[ ]
A= 0 1 0
1 0 1 D= [1 0 1; 0 2 1; 1 1 2] and det D=1

MATLAB SYNTAX MAT


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

0 1 0

1 0 1

D=A'*A D=1 0 1

0 2 1

1 1 2

det(D) ans =1
B. By using Cramer’s Rule, determine the solution to the following systems of linear equations. Write the
MATLAB SYNTAX you used and MATLAB out put on the space provided

ïìï 2 x1 + 4 x2 + 6 x3 = 2
ïï
í x1 + 2 x3 = 0
ïï
ïïî 2 x1 + 3x2 - x3 = 5
MATLAB SYSNTAX MATLAB OUTPUT
X1=[2; 1; 2] X1 =

X2=[4; 0; 3] X2 =

X3=[6; 2; -1] X3 =

-1

b=[2; 0; 5] b=

5
A=[X1 X2 X3] A=

2 4 6

1 0 2

2 3 -1

B=det(A) B=

26

x1=det([b X2 X3])/B x1 =

14/13

x2=det([X1 b X3])/B x2 =

10/13

x3=det([X1 X2 b])/B x3 =

-7/13

You might also like