Simplest way to calculate the maximum
1 view (last 30 days)
Show older comments
hello
I have a polynomial curve (with equation), using the optimisation Toolbox what is the easiest way to identify the maximum y point with its corresponding X value?
Many thanks. Gavin.
0 Comments
Accepted Answer
Alan Weiss
on 30 Jul 2015
It depends on whether you have a univariate polynomial (just one variable) or multidimensional polynomial.
For univariate, you might as well use fminbnd. You will simply have to figure out some bounds to use. A little experimentation should help.
For multidimensional, try fminunc. You will have to try a variety of initial points in order to find the global maximum.
And for either case, you will have to pass in the negative of the objective function, because these solvers minimize instead of maximize. For more info, see maximizing functions or maximizing an objective.
Alan Weiss
MATLAB mathematical toolbox documentation
0 Comments
More Answers (0)
See Also
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!