Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please show MATLAB code, thank you! :) EXERCISE 2 Enter the following matrix in MATLAB. A = -1 -1 1-3 -1 -9 7 37 7
Please show MATLAB code, thank you! :)
EXERCISE 2 Enter the following matrix in MATLAB. A = -1 -1 1-3 -1 -9 7 37 7 2 (a) Determine elementary matrices E1, E2, E3 of Type III such that E3E2E1A=U with U an upper triangular matrix. The matrix E1 should turn the element in position (2,1) into a 0. Enter this matrix in MATLAB as E1 using commands similar to the ones in Example 1. The matrix E2 should turn the element in position (3,1) into a zero. Enter this matrix in MATLAB as E2. Note that to zero out the entries in column 1, you need to add or subtract a multiple of row 1. Once you have found the matrices E1 and E2, compute the product E2E1A in MATLAB. Use format rat so that the entries will be given as fractions. Based on the result, determine the matrix E3 that turns the element in position (3,2) into a zero. Enter this matrix as E3 in MATLAB and compute U=E3*E2*E1*A. (b) Compute the product L = E1E, 1E7?. The matrix L is lower triangular with ones on the diagonal. Enter format short and verify that A = LU by computing A LU in MATLAB. NOTE: From part (a) we have E3E2E1A=U and therefore A = (E3E2E1)-1U = (E1EEz)U. Since the elementary matrices and their inverses are lower triangular and have ls along the diagonal, as is always true for elementary matrices of the third type, it follows that L is also lower triangular with l's along the diagonal. Elementary Matrices of Type III: To replace row j of the n x n identity matrix by the sum of row j plus c times row i, set E3 = eye(n); E3(j,i) = c EXERCISE 2 Enter the following matrix in MATLAB. A = -1 -1 1-3 -1 -9 7 37 7 2 (a) Determine elementary matrices E1, E2, E3 of Type III such that E3E2E1A=U with U an upper triangular matrix. The matrix E1 should turn the element in position (2,1) into a 0. Enter this matrix in MATLAB as E1 using commands similar to the ones in Example 1. The matrix E2 should turn the element in position (3,1) into a zero. Enter this matrix in MATLAB as E2. Note that to zero out the entries in column 1, you need to add or subtract a multiple of row 1. Once you have found the matrices E1 and E2, compute the product E2E1A in MATLAB. Use format rat so that the entries will be given as fractions. Based on the result, determine the matrix E3 that turns the element in position (3,2) into a zero. Enter this matrix as E3 in MATLAB and compute U=E3*E2*E1*A. (b) Compute the product L = E1E, 1E7?. The matrix L is lower triangular with ones on the diagonal. Enter format short and verify that A = LU by computing A LU in MATLAB. NOTE: From part (a) we have E3E2E1A=U and therefore A = (E3E2E1)-1U = (E1EEz)U. Since the elementary matrices and their inverses are lower triangular and have ls along the diagonal, as is always true for elementary matrices of the third type, it follows that L is also lower triangular with l's along the diagonal. Elementary Matrices of Type III: To replace row j of the n x n identity matrix by the sum of row j plus c times row i, set E3 = eye(n); E3(j,i) = cStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started