fzero function calculating all zeros within interval
Show older comments
Hello,
I was thinking about the function fzero. If you have a function that has multiple roots within an interval of your choice, is there a way to show all the roots as an array, instead of only one root closest to the guess?
Accepted Answer
More Answers (2)
Ben11
on 28 Jul 2014
Not for general functions. Certain functions, for example, have infinite roots in a finite interval, e.g., f(x)=0 or f(x)=sin(1/x). So of course the routine won't find all of them for you.
You can't reliably find multiple roots without exploiting some specific apriori known thing about the structure of the function, e.g., that it's a polynomial.
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!