function implicit_stability h=.5; t=0:h:100; [l,m]=size(t); x(1)=1; for i=2:m x(i)=1/(1+h)*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('implicit method') axis([0 100 Mi M])