How to deactivate the message

4 ビュー (過去 30 日間)
dav
dav 2013 年 7 月 15 日
Hi,
Every time I run the following code it outputs "optimization terminated".
I tried to insert options in linprog and set display off but it didnt work.
Can someone please help me with this?
thanks
x = sort(rand(100,1));
y = 1+2*x + rand(size(x))-.5;
% formulate the linear programming problem.
n = length(x);
% our objective sums both u and v, ignores the regression
% coefficients themselves.
f = [0 0 ones(1,2*n)]';
% a and b are unconstrained, u and v vectors must be positive.
LB = [-inf -inf , zeros(1,2*n)];
% no upper bounds at all.
UB = [];
% Build the regression problem as EQUALITY constraints, when
% the slack variables are included in the problem.
Aeq = [ones(n,1), x, eye(n,n), -eye(n,n)];
beq = y;
% estimation using linprog
params = linprog(f,[],[],Aeq,beq,[0;0],[0.999;0.999]);
% we can now drop the slack variables
coef = params(1:2)

採用された回答

Matt J
Matt J 2013 年 7 月 15 日
I tried to insert options in linprog and set display off but it didnt work.
Worked fine for me. Are you sure you did exactly the following
options=optimset('Display','off');
params = linprog(f,[],[],Aeq,beq,[0;0],[0.999;0.999],[],options);
  1 件のコメント
dav
dav 2013 年 7 月 18 日
THanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver 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