cannot stop fmincon displaying text output

17 vues (au cours des 30 derniers jours)
John Anderson
John Anderson le 12 Fév 2016
Commenté : John Anderson le 17 Fév 2016
I cannot seem to stop fmincon displaying text information in the command window even though I have set the display options to 'none' or 'off'
opt = optimset('Display','off', 'Algorithm', 'active-set' );
[ specSens( :, k ),~, ~,~ ] = fmincon(@objfunCor, x0, [ ], [ ], [ ], [ ], lb ,ub , [], opt, fTerm, sTerm, yTerm);
e.g.
Local minimum possible. Constraints satisfied.
fmincon stopped because the predicted change in the objective function
is less than the default value of the function tolerance and constraints
are satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
No active inequalities.
---------------------------------------------------------------------------------------------
MATLAB Version: 8.5.0.197613 (R2015a)
MATLAB License Number: •••••
Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) Client VM mixed mode
  2 commentaires
Alan Weiss
Alan Weiss le 12 Fév 2016
Are you sure that your value of opt is being passed to fmincon? I mean, you just gave us a code snippet, and I imagine that you have many other lines of code. I just want to make sure that opt is what you think it is when you call fmincon.
Also, I suggest that you use optimoptions for setting your options.
Alan Weiss
MATLAB mathematical toolbox documentation
John Anderson
John Anderson le 17 Fév 2016
First of all apologies for the delay in replying to your comments. And secondly, having failed to reproduce the error using a code snippet I eventually discovered that the display output was due to a subsequent constrained minimisation occurring later in my code that I missed by poor placement of a break-point when debugging. The display setting options for this later call were set to 'on' hence the report in the command window. Apologies for wasting your time and thanks again for your comments. Best wishes, John

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 12 Fév 2016
Passing any parameter after the options has undefined effect. It could do something like trigger the playing of Anchors Away on the line printer.
  1 commentaire
John Anderson
John Anderson le 17 Fév 2016
Hi Walter, apologies for the delay in replying (see comment above). This is some code I wrote a long time ago, I tend now to employ anonymous functions. However, I haven't had any problems in the past with using this method for passing additional parameters. Best wishes, John

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by