Question

I want to suppress the standard output of the fmincon like the below

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      

which is fired each time I use fmincon to find the minimum of a multivariate function.

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

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

So how to suppress the stdout of the fmincon?

Était-ce utile?

La solution

Before calling fmincon() you need to set various options which control how the function is applied.

In your case you will want to set 'Display' to 'off' like:

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

So in your case something like this should work:

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

More documentation is here.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top