| 查看: 169 | 回复: 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 ] |
» 猜你喜欢
一志愿太原理工安全工程300分,求调剂
已经有5人回复
调剂求院校招收
已经有4人回复
求化学调剂
已经有4人回复
085600,材料与化工321分求调剂
已经有7人回复
一志愿武汉理工,总分321,英一数二,求老师收留。
已经有6人回复
考研调剂
已经有6人回复
0856求调剂
已经有12人回复
0703化学
已经有9人回复
0703化学求调剂
已经有10人回复
317求调剂
已经有6人回复















回复此楼