fmincon函数的使用
发布网友
发布时间:2022-07-13 04:21
我来回答
共2个回答
热心网友
时间:2023-10-23 18:51
>> [x,fval]=fmincon('fmin',x0,[],[],[],[],-1.68,1.68)
Optimization terminated: magnitude of directional derivative in search
direction less than 2*options.TolFun and maximum constraint violation
is less than options.TolCon.
No active inequalities.
x =
1.668593592364594 0.581614920319626
fval =
-27.187778596177679
结果正确着呢!
因为你这是非线性有约束的最优化问题,只能用这个函数了
热心网友
时间:2023-10-23 18:51
函数编写不规范,可能是你的变量和使用的变量不匹配,少了