简体   繁体   English

在MATLAB中解决二次方程的最大化问题

[英]Solve maximization problem of quadratic equation in MATLAB

How do I solve a quadratic Maximization problem in MATLAB? 如何解决MATLAB中的二次最大化问题? It seems MATLAB only supports minimization problems, so is there a mathematical concept I can use? 看来MATLAB仅支持最小化问题,所以我可以使用数学概念吗?

只需在使用最小化函数之前和之后乘以(-1)

Using quadprog function in MATLAB. 在MATLAB中使用quadprog函数。

This function solves Quadratic Programming problems in MATLAB. 该函数解决了MATLAB中的二次编程问题。

Of course if you want the maxima instead of the minima, you can multiply the cost function by -1. 当然,如果您想要最大值而不是最小值,则可以将成本函数乘以-1。

Good Luck. 祝好运。

The above answer @Drazick seems not right. 上面的答案@Drazick似乎不正确。

quadprog() in matlab requires H to be positive definite. matlab中的quadprog()要求H为正定。 If we simply multiply (-1), - H is a negative definite matrix, which violates the requirement. 如果我们简单地乘以(-1),则-H是一个负定矩阵,这违反了要求。

Another optimization function called fmincon( ) may help. 另一个称为fmincon()的优化功能可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM