24小时热门版块排行榜    

查看: 464  |  回复: 2

zhangyang25

新虫 (初入文坛)

[求助] matlab工具箱能正常运行,但是跳出warning怎么回事

function f =myfun(x)
f =-x(1) * x(2) * x(3);
function [c , ceq] = mycon(x)
c=[];
ceq = x(2) *x(3) + x(3) *x(1) + x(1) * x(2)-75;
x0=[4;5;6];
   lb=zeros(3,1);
   [x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,[],[],[],[],lb,[],@mycon)
Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set algorithm. You could also try the interior-point
algorithm: set the Algorithm option to 'interior-point' and rerun.
> In fmincon at 460

Local minimum possible. Constraints satisfied.

fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints were
satisfied to within the default value of the constraint tolerance.



No active inequalities.

x =

    5.0000
    5.0000
    5.0000


fval =

-125.0000


exitflag =

     4


output =

         iterations: 7
          funcCount: 30
       lssteplength: 1
           stepsize: 1.1815e-006
          algorithm: 'medium-scale: SQP, Quasi-Newton, line-search'
      firstorderopt: 2.4478e-006
    constrviolation: 8.4075e-007
            message: [1x770 char]


lambda =

         lower: [3x1 double]
         upper: [3x1 double]
         eqlin: [0x1 double]
      eqnonlin: 2.5000
       ineqlin: [0x1 double]
    ineqnonlin: [0x1 double]
为什么结果都出来了,还有一个warning,这事怎么回事啊?这个warning会影响我的优化结果吗?谁能把帮帮我。。。
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

csgt0

荣誉版主 (著名写手)

彩色挂图

【答案】应助回帖

★ ★
感谢参与,应助指数 +1
xiegangmai: 金币+2, 谢谢参与! 2012-07-30 21:55:38
你可以看fmincon的帮助,主要是对不同的问题算法有点不一样,它会自动选择合适的,但你可以根据需要设置会更好的解决问题。至于优化结果,fmincon能获得一个极小值,与初始点位置有关系。结果是否正确还得需要自己判断。
showmethemoney
2楼2012-07-30 09:57:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhangyang25

新虫 (初入文坛)

谢谢你的回答,可是还是不怎么明白,我再琢磨琢磨。。。
3楼2012-08-04 10:55:22
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhangyang25 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[论文投稿] 十年后又回来了,论文投稿求助 +4 哈哈114477 2026-08-01 4/200 2026-08-07 14:39 by jgy194592
[基金申请] 听说今天filecode变了 +22 布布和一二 2026-08-06 45/2250 2026-08-07 14:14 by 日月天地
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] 关于豆爷回答的JTJC与%2F数量 +4 yang182083 2026-08-06 6/300 2026-08-07 12:43 by 虫友是什么虫
[基金申请] 面上再次挂了,太难了,躺也躺不了,倦也卷不过,小学校之殇! +23 低垂的野花 2026-07-31 31/1550 2026-08-07 12:22 by speculiar
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] 基金中了 +11 laoda193707 2026-08-06 11/550 2026-08-07 10:54 by TT和NN
[基金申请] 固定端突然变了,今天 +4 archvillain 2026-08-06 8/400 2026-08-07 08:06 by 带你看大海
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +9 archvillain 2026-08-04 11/550 2026-08-05 20:06 by wlwhappy
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
[考博] 【2027博士申请】纳米药物递送方向 20+3 13586093586 2026-08-03 4/200 2026-08-05 09:59 by lfy8008
[基金申请] 有没有H口的?有收到消息的吗? +3 超级海虾 2026-08-04 3/150 2026-08-04 17:26 by 学教育滴
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
[基金申请] 面上提前没消息,有中的吗 +14 archvillain 2026-08-02 18/900 2026-08-04 14:42 by archvillain
[基金申请] 娱乐 +4 Tide man 2026-08-03 4/200 2026-08-04 11:51 by wgch518
[基金申请] 什么时候能放榜呀? +3 Jacob678 2026-08-03 3/150 2026-08-03 16:14 by gltch
信息提示
请填处理意见