% Explicit Euler
%
% u' = -a*u
%
a=10;
dt=0.05; tmax = 1;
n=tmax/dt;
u = zeros(n+1); u(1)=1;
for j=1:n
    u(j+1) = u(j) - dt*a*u(j);
end
t=[0:dt:tmax];
plot(t,u); xlabel('t'); ylabel('u');    