How to deactivate the message
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Matt J
am 15 Jul. 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);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!