function [tout, yout] = euleroesplicito (odefun, tspan, y0)
%
% [tout, yout] = euleroesplicito (odefun, tspan, y0)
%
% Solve the ODE y'(t) = odefun (t, y(t)), where
%
% odefun is ...
% tspan is ...
% y0 is ...
% tout is ...
m = length (tspan) - 1;
yout = zeros (length (y0), m + 1);
yout(:, 1) = y0(:); % make y0 a column vector
k = tspan(2) - tspan(1);
for n = 1:m
  yout(:, n + 1) = yout(:, n) + k * odefun (tspan(n), yout(:, n));
end
tout = tspan(:);
yout = yout.'; % real transposition

