%Euler Soln of ODE
%xdot = x

n       = 100000001;  % number of points
x0    = 1; 
t_end = 2;

x = zeros(n,1);
x(1) = x0;   % IC

t = linspace(0, t_end, n);

for i = 1:n-1
    tnow= t(i);
    tnew = t(i+1);
    xnow = x(i);
h       = tnew - tnow;
xdotnow = xnow;
 xnew   =  xnow  + h * xdotnow;

x(i+1) = xnew; 

end

plot(t,x,t, exp(t))
shg
x(end) -exp(t_end)