QuestionQuestion

(2) Realize the experiment 2: Classical vs. Modified Gram-Schmidt on page 65-66, by writing the Algorithm 7.1 and Algorithm 8.1 as matlab functions.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

function gs()
% Comparing classic Gram-Schmidt vs Modifies G-S

% Creating a random matrix with singular values spanning large log range
N = 80;
nn = 1:N;
[U,X] = qr(randn(N));
[V,X] = qr(randn(N));
S = diag(2.^(-nn));
A=U*S*V;

% testing the two versions of GS
[qc,rc]=clgs(A);
[qm,rm]=mgs(A);

% Plot comparison to see who breaks first
% we plot absolute values because of possible numeric errors
f = figure(1);
semilogy(nn,abs(diag(rc)),'o', nn,abs(diag(rm)),'x');
legend('Classic GS','Modified GS');
ylabel('Diagonal elements of R');
xlabel('n');
set(gca, 'XGrid','On');   
set(gca, 'YGrid','On')...

By purchasing this solution you'll be able to access the following files:
Solution2.m and Solution1.pdf.

$39.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Numerical Analysis Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats