% Matlab diary from CS 111, 27 Sep 2010 % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. 3+4 sin(3.14) help sin sin(3.141592653589793238462643383) pi format long pi sin(pi) help help randfun rand rand rand help rand rand(5) format short rand(5) randperm(10) randperm(10) randperm(10) randperm(10) clc help ncm fern finitefern(100000) edit fern A1 = [ .85 .04; -.04 .85]; b1 = [0; 1.6]; A1 b1 x = [ .5 ; 1/2] figure axis on x plot(x(1),x(2)) plot(x(1),x(2),'ro') x = A1 * x + b1 hold on plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') clf finitefern(100000) hold on x = [ .5 ; 1/2] plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') x = A1 * x + b1 plot(x(1),x(2),'ro') p = [ .85 .92 .99 1.00]; A1 = [ .85 .04; -.04 .85]; b1 = [0; 1.6]; A2 = [ .20 -.26; .23 .22]; b2 = [0; 1.6]; A3 = [-.15 .28; .26 .24]; b3 = [0; .44]; A4 = [ 0 0 ; 0 .16]; whos x = [ .5 ; 1/2] plot(x(1),x(2),'ro') x = A2 * x + b2 plot(x(1),x(2),'ro') A2 diary off