function [t,w]=modeuler(y0,a,b,h)
% modeuler(1,0,1,0.1);

N=(b-a)/h;
t=linspace(a,b,N+1);
w(1)=y0;
for i=1:N
    k1=w(i)+h*defunc(t(i),w(i));
    w(i+1)=w(i)+h/2*(defunc(t(i),w(i))+defunc(t(i+1),k1));
end
[T,Y] = ODE45('defunc',t,y0);
plot(T,Y)
hold on
plot(t,w,'o')
hold off
error=max(abs(w-Y'))