Can the function "Taylor" process the input type "Function handle" directly?

3 views (last 30 days)
Like what I said, every time I use the "taylor" function, I need to convert the function to a symbolic equation, which isn't very convenient because sometims these two things can't be converted, eg:
receive_power_theo = @(misalignment_integ) integral(@(theta) integ_func(theta,misalignment_integ),0,2.*pi)*N_UCA./2./pi;
Apparently, integ_func is a function handle. And this can't be converted because of the integral term.
Any answer helps.
Thanks in advance!

Accepted Answer

John D'Errico
John D'Errico on 26 Jun 2022
Edited: John D'Errico on 26 Jun 2022
Can taylor handle some completely general function handle? No. Why not?
A Taylor series is easy to compute, in theory. The coefficients of the terms are just derivatives, of increasing order for each power of x, so as long as you can symbolically differentiate what you give it, and do so for arbitrarily high orders of differentiation as needed by the number of terms in your Taylor series there is no problem.
The problem arises when you want to give the function taylor some general function handle. In this case, you have written a function handle that internally uses a call to integral, which does an ADAPTIVE numerical integration. Taylor cannot solve that problem. Sorry. In general, Taylor NEEDS a function it can symbolically differentiate. Even then, not all functions have Taylor series.
  7 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!