hw2p2sol

hw2p2sol - % We see a 7% error in the factorization - many...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% % Homework 2 Problem 2 % A=-.99999*tril(ones(60,60),-1)+eye(60); A(:,60)=ones(60,1); [L,U]=lu(A); xtrue=randn(60,1); b=A*xtrue; x=U\(L\b); Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.735235e-18. norm(L*U-A)/norm(A) ans = 0.0698
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % We see a 7% error in the factorization - many orders of magnitude % larger than in Problem 1. This indicates an instability in the % factorization. norm(x-xtrue)/norm(xtrue) ans = 0.1513 % Similarly we have a 15% error in the solution....
View Full Document

This note was uploaded on 05/08/2009 for the course MATH 5316 taught by Professor Dr.thomashagstrom during the Spring '09 term at SMU.

Ask a homework question - tutors are online