Why Matlab does not have a fmaxsearch?

I know that Matlab has a fminsearch, but why it does not have a fmaxsearch?

2 comentarios

Dainery
Dainery el 4 de Mzo. de 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 el 4 de Mzo. de 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.

Iniciar sesión para comentar.

 Respuesta aceptada

Matt J
Matt J el 3 de Nov. de 2013
Editada: Matt J el 3 de Nov. de 2013

5 votos

Because you can easily convert a maximization problem to a minimization problem just by multiplying the function by -1.

4 comentarios

Bernardino
Bernardino el 3 de Nov. de 2013
Make sense, thank you so much.
Sinan Islam
Sinan Islam el 12 de Nov. de 2022
I think you mean the opposite? To convert minimization to maximization you multiply the objective function by -1?
Matt J
Matt J el 12 de Nov. de 2022
No, I meant how I phrased it originally, but both are true.
Walter Roberson
Walter Roberson el 13 de Nov. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Nov. de 2013

Comentada:

el 4 de Mzo. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by