필터 지우기
필터 지우기

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);

추가 답변 (0개)

카테고리

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