Question: EXERCISE 4 Enter the matrix A and the vector b in MATLAB: A = [ - 8 7 - 2 1 - 5 2 -

EXERCISE 4
Enter the matrix A and the vector b in MATLAB:
A=[-87-21-52-2988-1-45227],b=[4881-7535]
The exact solution to the system Ax=b is the vector x=(-6,1,7,7)T.
(a) Enter [L,U,P]=lu(A) to find the LU factorization of the matrix PA. Verify that
PA=LU by computing PA-LU.
(b) Use the LU factorization you found in part (a) to solve the system Ax=b. Call the
computed solution xlu(don't forget that you will need P*b).
(c) Enter the vector x and compare your solution x-1u from part (b) with the exact solution
x by computing norm (xlu-x)
NOTE: the norm function gives the magnitude of the vector, that is, for a vector a=
(a1,a2,dots,an)T, the norm of a is defined as: norm(a)=a12+a22+dots+an22. Thus
the command norm(xlu-x) measures how close the computed solution xlu is to the
exact solution x . You should expect a very small number.
EXERCISE 4 Enter the matrix A and the vector b in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!