% % code10Fb.m -- log-log error plots -- 08 nov 02 (djm) % Etest = [1.1325 0.2167 0.0505 0.0124]; Ntest = [100 400 1600 6400]; Itest = [-0.0013 -3.8225e-04 -2.9076e-05 -1.8999e-06]; figure(2); clf; hold on plot(log10(Ntest),log10(abs(Etest)),'x') plot(log10(Ntest),log10(abs(Itest)),'o') axis([1.8 4 -6 0.5]) plot([3 4],[-1 -2],'r') plot([3 4],[-4 -6],'r') text(3.3,-1.2,'\bf slope=-1') text(3.3,-4.2,'\bf slope=-2') title('\bf log-log plot of |error(N)| for Euler''s methods') xlabel('\bf N-axis') ylabel('\bf |error|-axis')