cannot stop fmincon displaying text output

17 次查看(过去 30 天)
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 个评论
Alan Weiss
Alan Weiss 2016-2-12
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 2016-2-17
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

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2016-2-12
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 个评论
John Anderson
John Anderson 2016-2-17
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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by