How to deactivate the message
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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)
0 commentaires
Réponse acceptée
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);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display 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!