
function [T,Y]=eulerS(f,Tspan,ya,n)
% Simple version of Euler's method for scalar diff. equ.
% (We have eulerV for vector (including scalar) version.
%  HA 
% Example: y'=t+y, y(0)=1
%       f=@(t,y)t+y
%       [T,Y]=eulerS(f,[0 4],1,6), plot(T,Y,T,Y,'.r');shg  
a=Tspan(1);b=Tspan(2);
h=(b-a)/n;
Y=zeros(n+1,1);T=(a:h:b)'; % Column vectors in accordance with 
Y(1)=ya;                   %  ode45 etc.
for j=1:n
   Y(j+1)=Y(j)+h*f(T(j),Y(j));
end;


end

