필터 지우기
필터 지우기

cannot stop fmincon displaying text output

조회 수: 6 (최근 30일)
John Anderson
John Anderson 2016년 2월 12일
댓글: John Anderson 2016년 2월 17일
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