clc; clear all; a=0; for i=1:10 r(i)=g(a) a=r(i); if err(i)<0.01 break end end
Standard input is empty
r = 1 Iter: 1 APP_root: 1.000000 Error: 100.00000 r = 1.00000 0.36788 Iter: 2 APP_root: 0.367879 Error: 171.82818 r = 1.00000 0.36788 0.69220 Iter: 3 APP_root: 0.692201 Error: 46.85364 r = 1.00000 0.36788 0.69220 0.50047 Iter: 4 APP_root: 0.500474 Error: 38.30915 r = 1.00000 0.36788 0.69220 0.50047 0.60624 Iter: 5 APP_root: 0.606244 Error: 17.44679 r = 1.00000 0.36788 0.69220 0.50047 0.60624 0.54540 Iter: 6 APP_root: 0.545396 Error: 11.15662 r = 1.00000 0.36788 0.69220 0.50047 0.60624 0.54540 0.57961 Iter: 7 APP_root: 0.579612 Error: 5.90335 r = 1.00000 0.36788 0.69220 0.50047 0.60624 0.54540 0.57961 0.56012 Iter: 8 APP_root: 0.560115 Error: 3.48087 r = Columns 1 through 8: 1.00000 0.36788 0.69220 0.50047 0.60624 0.54540 0.57961 0.56012 Column 9: 0.57114 Iter: 9 APP_root: 0.571143 Error: 1.93080 r = Columns 1 through 8: 1.00000 0.36788 0.69220 0.50047 0.60624 0.54540 0.57961 0.56012 Columns 9 and 10: 0.57114 0.56488 Iter: 10 APP_root: 0.564879 Error: 1.10887