Why Matlab does not have a fmaxsearch?

75 views (last 30 days)
I know that Matlab has a fminsearch, but why it does not have a fmaxsearch?
  2 Comments
Dainery
Dainery on 4 Mar 2024
Matlab tiene una función llamada fminsearch, pero no tiene una función llamada fmaxsearch. La razón probable por la que no existe una función fmaxsearch es porque generalmente en problemas de optimización se busca minimizar una función objetivo en lugar de maximizarla. En el caso de querer encontrar el máximo de una función en Matlab, se puede simplemente multiplicar la función por -1 y utilizar fminsearch para encontrar el mínimo de la función negativa. De esta manera se obtendrá el máximo de la función original.
Walter Roberson
Walter Roberson on 4 Mar 2024
Approximate translation:
Matlab has a function called fminsearch, but it does not have a function called fmaxsearch. The likely reason why there is no fmaxsearch function is because optimization problems generally seek to minimize an objective function rather than maximize it. If you want to find the maximum of a function in Matlab, you can simply multiply the function by -1 and use fminsearch to find the minimum of the negative function. In this way the maximum of the original function will be obtained.

Sign in to comment.

Accepted Answer

Matt J
Matt J on 3 Nov 2013
Edited: Matt J on 3 Nov 2013
Because you can easily convert a maximization problem to a minimization problem just by multiplying the function by -1.
  4 Comments
Matt J
Matt J on 12 Nov 2022
No, I meant how I phrased it originally, but both are true.
Walter Roberson
Walter Roberson on 13 Nov 2022
  • if you need to do a minimization and all you have available is a minimization function, use that
  • if you need to do a maximization and all you have available is a maximization function, use that
  • if you need to do a minimization and all you have available is a maximization function, then maximize the negative of the function you need to minimizat
  • if you need to do a maximization and all you have available is a minimization function, then minimize the negative of the function you need to maximize
MATLAB only provides minimization functions (except for Problem Based Optimization, you can tell those to maximize), so if you need to minimize use one of the minimization functions, and if you need to maximize then use one of the minimization functions on the function you need to maximize.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox 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!