function coeff = Taylor(fun,a,n,more_args) % % Find the coefficients of an n-th order Taylor series near x=a % Inputs: % % fun: function that calculates f(x) or its derivatives % fun(x,n,args) % x = value for evaluation % n = which derivative (n=0 means f(x)) % args = additional arguments % a: expand f(x) about x=a % n: Calculate n terms of the series % more_args: Vector of zero or more additional arguments % to be passed to fun(x,n,more_args) % % Output: coeff = polynomial coefficients % error(nargchk(3,4,nargin));