% CLASS27SEPT.TXT Commands I used in class on Monday, % regarding fixed point iteration of some simple functions. % % Suggestion: Cut and paste these to the command line. % You can run this as a program (i.e. save as .m), but % it does not produce nice output; it spews lots of numbers. % manually do fixed point iteration for g(x) = cos(x): p = 100*randn(1) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) p=cos(p) % continue by automating it: format long for j=1:30, p=cos(p), end % similar for g(x) = sin(x) and g(x) = tan(x): p=116.52, for j=1:30000, p=sin(p), end % slow convergence to zero p=116.52, for j=1:30000, p=tan(p), end % rather unpredictable