clear all,clc;
dydt=@(t,y) 1+t-y;
for h=[0.2 0.1 0.05]
    y=1;
    Y=y
    disp(['h= ' num2str(h)])
    for t=0:h:0.8-h
        disp(['t= ' num2str(t) '   y= ' num2str(y)])
        y=y+h*dydt(t,y);
        Y=[Y y];
    end
    disp(['t= ' num2str(t+h) '   y= ' num2str(y)])
    plot(0:h:0.8,Y,'b')
    hold on
end
yt=@(t) exp(-t)+t;
plot(0:h:0.8,yt(0:h:0.8),'r');
