function t = taylor(f,x,n)
%TAYLOR	Taylor series expansion.
%	TAYLOR(f) returns the Taylor series expansion of f using the 
%	variable determined by SYMVAR.
%	TAYLOR(f,'v') uses the variable 'v'.
%	TAYLOR(f,n) uses n terms in the expansion instead of the default n = 6.
%
%	See also SYMVAR.

%	Copyright (c) 1993-95 by The MathWorks, Inc.
%	$Revision: 1.9 $  $Date: 1995/03/01 21:39:02 $

if nargin == 1
   x =  symvar(f);
   n = 6;
elseif nargin == 2
   if isstr(x)
      n = 6; 
   else
      n = x;
      x = symvar(f);
   end
end
t = maple('taylor',f,x,n);

% Peel off the series(...) notation
commas = find(t==',');
t = t(8:commas(length(commas)-1)-1);
