Min/Max Values of a polynomial function using yminbnd

7 views (last 30 days)
I'm having trouble figuring out how to use the yminbnd function correctly, as well as finding the max of this function within the interval [-3,4] I can find the roots fine, but the overall objective to my question, is how do I find the min/max of the polynomial x^3-2x^2-11x+10, and assign those variables to ymin and ymax.I plotted the graph to get a visual representation to check my answers, looks like these values should be around -15, and +20. Any help is appreciated, thank you!
  1 Comment
John D'Errico
John D'Errico on 22 Nov 2020
There is no yminbnd function. You said that multiple times. fminbnd will probably work better. But it looks like you already know that, at least when you write code.
Your question is how do you find the min. You already know how to find the min. You set that into ymin. So what is the problem? Let me guess. Your real question in this was you cannot find the max using a tool that knows only how to minimize. But then what would happen if you used the tool to minimize the negative of f(x)? Would that not be an implicit MAXIMIZATION?
What does this do?
@(x) -f(x)

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!