MATLAB: Do I receive the error “??? No appropriate methods for function …” when using symbolic functions

appropriateerrorforfunctionmethodsnosymbolicSymbolic Math Toolbox

When I execute the following command:
taylor('exp(-x)')
I receive the following error message:
??? No appropriate methods for function taylor.

Best Answer

In order to use a symbolic function in MATLAB you must first declare symbolic variables with the SYM command. Please try the following syntax:
syms x
taylor(exp(-x))
Alternately, if you have a numeric value in the variable x and you don't want to overwrite it:
x=0.5;
T=taylor(sym('exp(-x)'))
subs(T)
Related Question