How can I get all possible solutions for an equation?
Show older comments
I need to get all possible solutions for this equation:
sin(x)/x == a
for "0.2 < a < 1", it has 3 to 5 solutions but matlab functions such as "solve" and "vpasolve" only return the first solution they find. How can I get all the answers? should I use another function?
thank you all payman
Accepted Answer
More Answers (1)
John D'Errico
on 26 Aug 2014
0 votes
All possible solutions is in general an impossible thing for a completely general function, since there may be infinitely many such solutions.
If you know there are a finite number of solutions, and can bound them, then just sample your function on a fine enough interval, and use fzero over brackets generated by the sampling. WTP?
Categories
Find more on Mathematics 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!