  %******************************************
  %function File: ExpTaylorTerm
  % Calculates approx to exp function using
  %  n-term
  % Taylor approximation
  %
  %           1 + x + x^2/2! +...+ x^n/n! 
  %
  function [y] = ExpTaylorTerm (x,n)
  %input: x is argument for function
  %        n is number of terms
  %Output: y is the approximation to exp(x)
     s = 1;  %first (k=0)term
     term = 1;  %first (k=0) term
     for k=1:n-1
        term = x.*term/k;%the next term in series
        s = s+ term;%  Adds that term in to summation
     end
     y=s;
  end
  %*************************************
