How to deactivate the message

2 vues (au cours des 30 derniers jours)
dav
dav le 15 Juil 2013
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)

Réponse acceptée

Matt J
Matt J le 15 Juil 2013
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 commentaire
dav
dav le 18 Juil 2013
THanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by