Question: In this exercise, you have to write a Matlab script that performs the following tasks in the specified order: 10-31 1. Define the matrix A
In this exercise, you have to write a Matlab script that performs the following tasks in the specified order: 10-31 1. Define the matrix A = 0 1 4 and assign it to the variable A. 2 2 15 2. Define the following 3 x 3 elementary matrices and assign them to variables E1 through E4: i) E: Add 2 times row 1 to row 3 ii) Ey: Add 2 times row 2 to row 3 iii) Eg: Add-4 times row 3 to row 2 iv) Ex: Add 3 times row 3 to row 1 3. Compute the product E,E3E_EA and assign the result to variable R. 4. If Ris an identity matrix, then compute the product det(E7) det(Ez ') det(E3') det(EZ) and assign it the variable deti A. 5. Compute the determinant of A and assign it to the variable del 2 A. 6. Create a logical variable chkdet which gets assigned a logical 1 if deti A and det2 A are equal and a logical 0 if deti_A and det2_A are not equal. 7. Display the value of chkdet Save this script as myexercise2_xx.m with xx replaced by your initials. Execute the code and if the displayed value of chkdet equals 1, explain in the space below why the determinant calculation that lead to deti_A is a viable method for computing the determinant of a matrix. You may want to revisit the Section 2.5 of the textbook on Elementary Matrices
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
