Why do I receive the error "??? No appropriate methods for function ..." when using symbolic functions?

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

 Accepted 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)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!