Filter löschen
Filter löschen

Min/Max Values of a polynomial function using yminbnd

5 Ansichten (letzte 30 Tage)
Joseph DeMaria
Joseph DeMaria am 22 Nov. 2020
Kommentiert: John D'Errico am 22 Nov. 2020
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 Kommentar
John D'Errico
John D'Errico am 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)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by