Why Matlab does not have a fmaxsearch?

77 次查看(过去 30 天)
I know that Matlab has a fminsearch, but why it does not have a fmaxsearch?
  2 个评论
Dainery
Dainery 2024-3-4
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 2024-3-4
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.

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2013-11-3
编辑:Matt J 2013-11-3
Because you can easily convert a maximization problem to a minimization problem just by multiplying the function by -1.
  4 个评论
Matt J
Matt J 2022-11-12
No, I meant how I phrased it originally, but both are true.
Walter Roberson
Walter Roberson 2022-11-13
  • 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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by