Matlab:抑制fmincon的标准输出?

时间:2013-11-26 02:38:01

标签: matlab stdout verbosity

我想抑制fmincon的标准输出,如下所示

Optimization completed because the objective function is non-decreasing in 
feasible directions, to within the default value of the function tolerance,
and constraints are satisfied to within the default value of the constraint tolerance.

<stopping criteria details>

Active inequalities (to within options.TolCon = 1e-06):
  lower      upper     ineqlin   ineqnonlin
    1          1                      
    2          2                      
    3          3                      
    4          4                      
    5          5                      
    6          6                      
    7          7      

每次使用fmincon查找多变量函数的最小值时都会触发。

    x0=lb; %guess
    A=[];
    b=[];
    Aeq=[];
    beq=[];

    global mlf1;
    mlf1=mlf;
    [x,fval]=fmincon(@HenriMLF.mlfEvalAtPoint,x0,A,b,Aeq,beq,lb,ub);

那么如何抑制fmincon的标准输出?

1 个答案:

答案 0 :(得分:4)

在调用fmincon()之前,您需要设置各种控制函数应用方式的选项。

在您的情况下,您需要将“显示”设置为“关闭”,如:

options = optimoptions('Display', 'off');

所以在你的情况下,这样的事情应该有效:

[x,fval]=fmincon(@HenriMLF.mlfEvalAtPoint,x0,A,b,Aeq,beq,lb,ub,options);

更多documentation is here