Download Lab 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Cartesian tensor wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Determinant wikipedia , lookup

Equation wikipedia , lookup

System of polynomial equations wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

History of algebra wikipedia , lookup

Orthogonal matrix wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Linear algebra wikipedia , lookup

Matrix calculus wikipedia , lookup

Matrix multiplication wikipedia , lookup

System of linear equations wikipedia , lookup

Transcript
Practice problems – AMAT181
Matrices in MatLab
Student’s Name:
Part 1: Solving Linear Systems using Crame’r Rule
 a11 x  a12 y  a13 z  b1

The system of equations a21 x  a22 y  a23 z  b2
a x  a y  a z  b
32
33
3
 31
can be written in the form A.x  b where,
 a11

A   a21
a
 31
a12
a22
a32
a13 

a23  ,
a33 
 b1 
x


x   y  , b  b2  .
 z 
b3 
Obtain the determinants   A ,  x ,  y , and  z by replacing the column in A of the x, y,
and z-coefficients respectively by b. Thus we have
a11
a12
a13
b1
a12
a13
a11
b1
a13
a11
a12
b1
  A  a21
a22
a23
 x  b2
a22
a23
 y  a21 b2
a23
 z  a21
a22
b2
a31
a32
a33
b3
a32
a33
a31 b3
a33
a31
a32
b3
Using Cramer’s rule, the solution of the system
x
y
x

, y
and z  z



Exercise 1:
Given the following set of equations find the solution using Cramer’s rule:
2x  3y  z  4
3x  y  2 z  13
x  2 y  5 z  11
Step 1: Create the matrices needed to calculate the determinants  ,  x ,  y , and  z .
Copy your work here
Page 1 of 4
Practice problems – AMAT181
Step 2: Calculate the determinants  ,  x ,  y , and  z .
Copy your work here
Step 3: Use Cramer’s Rule to find the values of x, y, and z.
Copy your work here
Page 2 of 4
Practice problems – AMAT181
Part 2: Some more build-in functions in MatLab and Solving Linear Systems
using Gaussian Elimination
Exercise 2:
Given the following set of equations find the solution using Gaussian Elimination
2x  3y  z  4
3x  y  2 z  13
x  2 y  5 z  11
Step 1: Create the matrix A and vector b .
Copy your work here
Step 2: To find the solution (i.e. the values of x, y and z) use x = A\b. (\ = left matrix
divide, see help mldivide for details)
Copy your work here
Page 3 of 4
Practice problems – AMAT181
Part 3: Inverse matrix method
Exercise 3:
Given the following set of equations find the solution using the inverse matrix method
2x  3y  z  4
3x  y  2 z  13
x  2 y  5 z  11
Step 1: Create the matrix A and vector b .
Copy your work here
Step 2: To find the inverse matrix of A. (inv(A))
Copy your work here
Step 3: Find the solution of the system (i.e find x, y, z) by multiplying A1  b
Copy your work here
Page 4 of 4