function second_taylor_stability h=1.3; t=0:h:100; [l,m]=size(t); x(1)=1; for i=2:m x(i)=(1-h+h/2)*x(i-1); end M=max(abs(x)); if (M>1) M=10; Mi=-10; else Mi=-1; M=1; end y=exp(-t); figure(1) plot(t,y,'r',t,x,'b') title('second order taylor method') axis([0 100 Mi M])