function euler ( )

%  Reference:
%
%    Ward Cheney & David Kincaid
%    Numerical Mathematics and Computing, Fifth Edition
%    Brooks/Cole Publishing Company, 2003.
%
% Euler's method:
% The function f is defined in the M-file 'f.m'.

  a = 0;
  b = 4;
  n = 20,
  h = (b - a)/n;
  t = a;
  T = t;
  x = 1.0;
  X = x;
  for  i=1:n
    x = x + h*f(t,x);
    t = t + h;
    X = [X, x];
    T = [T, t];
  end
  S = a:h/4:b;
  Y = exp(S);
  plot(T,X,'o', S,Y,'-');

  filename = 'euler.png';
  print ( '-dpng', filename );
  fprintf ( '  Graphics saved as "%s"\n', filename );

  return
end


