% Matlab diary from cs111, Oct 3 2007. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. diary on finitefern(10000) finitefern(100000) edit fern A1 = [ .85 .04; -.04 .85]; b1 = [0; 1.6]; A1 b1 x = [.5 ; .5] I eye(2) eye(7) I =eye(2) I-A1 A1 A = I - A1 d =[ 2 ;3 ] A d * A d = d' d = 2 3 A d * A x = A \ b1 A * x b1 residual = b1 - A*x axis on axis( [ -3 5 0 12]) hold on x1 = -3 : 5 x2 = .15*x1 / .04 plot(x1, x2) x2 = (-.04*x1 + 1.6) /.15 plot(x1,x2,'r') clc clear load temperature whos A4 b4 clc spy(A4) t = A4\b4 T = reshape(t,4,4) T = T' T = flipud(T) size(A100) spy(A100),shg size(b100) b100(1) b100(100) b100(101) t = A100 \ b100; t T = reshape(t,100,100); T T = flipud(T'); max(t) min(t) size(T) surf(T) help surf help surfc surfc(T) diary off