Simplest way to calculate the maximum

1 vue (au cours des 30 derniers jours)
Gavin Seddon
Gavin Seddon le 30 Juil 2015
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.

Réponse acceptée

Alan Weiss
Alan Weiss le 30 Juil 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

Plus de réponses (0)

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by