| 查看: 166 | 回复: 0 | |||
| 当前主题已经存档。 | |||
[交流]
【已解决】求教一个关于fmincon的弱问题
|
|||
|
目前要做关于优化的问题,和fmincon函数使用有关,但是不管我运行help里面的例子,还是网上找的例子,运行都失败,请达人帮忙指点一下吧,非常感谢。 比如help里的例子: function f = myfun(x,a) f = x(1)^2 + a*x(2)^2; and function [c,ceq] = mycon(x,b) c = b/x(1) - x(2); ceq = []; To optimize for specific values of A and B, first assign the values to the se two parameters. Then create two one-argument anonymous functions that capt ure the values of A and B, and call MYFUN and MYCON with two arguments. Finall y, pass these anonymous functions to FMINCON: a = 2; b = 1.5; % define parameters first x = fmincon(@(x)myfun(x,a),[1;2],[],[],[],[],[],[],@(x)mycon(x,b)) 请高手运行一下,看是否能成功,指导一下吧! =================================================== 原来是我的软件问题,重装一下就解决了。 [ Last edited by compiler on 2010-4-9 at 07:28 ] |
» 猜你喜欢
情人节自我反思:在爱情中有过遗憾吗?
已经有5人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有6人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有9人回复
售SCI一区文章,我:8 O5 51O 54,科目齐全,可+急
已经有8人回复
球磨粉体时遇到了大的问题,请指教!
已经有12人回复
江汉大学解明教授课题组招博士研究生/博士后
已经有3人回复














回复此楼