Linear algebra, DUE IN 10 HOURS. matlab knowledge
ENGR 231 – Linear Engineering Systems
Lab 5: Summer 2016
Your Name: _______________________ Indicate Section: 61 or 62.
As a convenience, this answer template is provided if you wish to easily submit your work. Be sure to save it as a PDF before submitting online! Only one submission is allowed.
Question 1: Find the inverse of .
Question 1: The inverse is:
The MATLAB code used is:
Question 2: Verify the identity: for ,
Which of these gives the zero matrix?
i. inv(A*B) - inv(A) * inv(B)
ii. inv(A*B) - inv(B) * inv(A)
Question 2: Which of the two lines of code gives the zero matrix?
For what values of a and b does the order not matter?
Questions 3-4: Find the inverse of the matrix by reducing the block matrix .
Questions 3-4: Paste in all your code for this problem here.
The inverse of A is:
Question 5: Checkerboard plot of a matrix and its inverse.
Replace the plot below with your completed plot showing both A and A–1.
Question 6: The Adjoint Formula for the Inverse
Find the inverse of the matrix using the adjoint() and det() commands.
Recall the adjoint formula:
Question 6:
The determinant of B is:
The adjoint of B is:
Question 7: A system of five equations for five unknowns has a unique solution. Find it !
Question 7: Write out the solution.
The unique solution is:
(A few of the components are given so you can check your work.)
Question 8: Cramer's Rule inside a for loop: Paste in your code to complete this for loop.
See missing steps 1, 2, 3.
clear, clc
A = [2 0 0 1 3; -2 0 1 2 -2; -5 0 0 -3 4; 5 1 0 -5 1; 2 1 4 -4 2];
b = [9;-3;0;3;7];
dA = det(A) % Use this in your for loop below.
% The body of the for loop is missing below. Complete the missing three steps.
for i = 1:5
% 1. <- Make a copy of A and name it Ai.
% 2. <- Replace column i of Ai with b
% 3. Find the ith unknown x(1,i) using Cramer's formula.
end
x % Prints out the solution
Questions 9-10: Cryptographic Example:
Questions 9 and 10:
a. Show the line of code you fixed using the round() command. Just show the one line.
>>
b. Decode the following secret message, and paste in what it says!
coded_message =
75 251 28 134 249 -59 106 268 124 16 79 -33
264 404 163 349 396 148 321 400 333 157 309 171
262 469 161 361 463 70 317 484 343 149 291 103
The secret message says:
When your lab is complete, be sure to submit it as a PDF by the due date – this Thursday before 11:59PM. You have one more day, to submit the lab (but with a small penalty), and then the window closes for good and your grade will be zero. Only one submission is allowed per student.
1