function [tout,yout] = euler_tdelillo4(F,tspan,y0,n)
% euler - compare with odetx from Moler's book
% note tspan = [t0 tf] 
% note  y0 = 1 by k vector of initial conditions
% but dydt = F(t,y) return a k by 1 vector
% tout should be a column vector
% yout should be an n x lengthby
t0=tspan(1);
tf=tspan(2);
h=(tf-t0)/n;
t=t0;
tout(1,1) = t;
y=y0(:); % make y a k by 1 vector
yout(1,:) = y.';
% Euler loop
for k=1:n
  s1 = F(t,y);
  y = y + h*s1; % odetx use ynew here
  t = t + h;  % odetx usues tnew but not needed here
  tout(k+1,1) = t;
  yout(k+1,:) = y.';  % add y as kth row of yout
end
  

