Question: In a class announcement this week, you will be given scripts for the MATLAB functions gs . m and mgs . m , which implement

In a class announcement this week, you will be given scripts for the MATLAB functions gs.m and mgs.m, which implement the codes given in class for classical and,
respectively, modified Gram-Schmidt.
Copy them in your MATLAB directory, then go back to the Command Window and
type
A = hilb(8);
This makes A a particularly ill-conditioned 8\times 8 matrix form MATLABs matrix
library.
1
Then, call
[Q1, R1]= gs(A);
[Q2, R2]= mgs(A);
to get the computed factors Q1 and R1, respectively, Q2 and R2, with the classical,
respectively, modified Gram-Schmidt algorithms.
Check how close Q1 and Q2, respectively, R1 and R2 are by typing
checkQ = norm(Q1 Q2)
checkR = norm(R1 R2)
Finally, let us now test the quality of the Q1 and Q2 factors. At the prompt, type
orthoQ1= norm(Q1
Q1 eye(8)),
followed by
orthoQ2= norm(Q2
Q2 eye(8))
These commands let you know how close to orthogonal the matrices Q1, respectively
Q2, are.
By examining checkQ, checkR, orthoQ1 and orthoQ2, explain how classical GramSchmidt and modified Gram-Schmidt perform on this ill-conditioned matrix. Take
screenshots of the Command Window, making sure the outputs to the last 4 commands
are visible.

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 Databases Questions!