% Starting diary file diary-20-Oct-2010.txt A = 4 b = 1 xstar = A \ b x = .2 error = x - xstar residual = A*x - b A * error residual A = [ 2 -1 ; -1 2] b = [0 ; 3] A \ b xstar = [ 1 ; 2] A * xstar - b x = [1.1 ; 2.2] error = x - xstar residual = A * x - b v = [1;2;3] norm(v) 1 + 4 + 9 sqrt(14) norm(v,2) norm(v,3) norm(v,1) norm(v,Inf) norm(v) error residual norm(error) norm(residual) A x = [1;1] A*x norm(x) norm(A*x) norm(A*x) / norm(x) x = [ 1 ; -1 ] norm(x) A * x norm(A*x) norm(A*x) / norm(x) for i = 1:100 x = randn(2,1); stretch(i) = norm(A*x) / norm(x); end; plot(stretch,'.') hist(stretch) min(stretch) max(stretch) eigshow(A) norm(A) clc A1 = A A2 = [1.6 1.5 ; 1.5 1.4] norm(A1) norm(A2) x = [ 1 ; 1] A2*x norm(A2*x)/norm(x) x = [ 1 ; -1 ] norm(x) A2*x norm(A2*x)/norm(x) eigshow(A1) eigshow(A2) cond(A1) cond(A2) A = randn(1000); cond(A) tic, cond(A), toc tic,lu(A);toc load temperature size(A100) help condest cond(A) condest(A) size(A100) cond(A1) cond(A2) condest(A100) t = A100\b100; resid = norm(A100*t-b100) diary off