Force linprog to use simplex method
Show older comments
Hi everyone,
I want linprog to use simplex method, but when I check the output I still see that it uses the default method (Interior point).
This my code:
f=[];
A=[-1 -1 -0.94
1 1 0.94
-1 -1 -0.54
1 1 0.54
-1 -0.664 -0.313
1 0.664 0.313
-1 -0.260 -0.228
1 0.260 0.228
-0.736 -0.176 -0.09
0.736 0.176 0.09
-0.401 -0.050 -0.031
0.401 0.050 0.031];
b=[-0.9
1
-0.6
0.75
-0.4
0.55
-0.2
0.35
-0.12
0.22
-0.05
0.1];
Aeq=[1 1 1];
beq=[1];
options = optimoptions('linprog','Algorithm','active-set')
[x,fval,exitflag,output,lambda]=linprog(f,A,b,Aeq,beq,[],[],[],'options')
And how can I increase the iterations?
Answers (1)
Remove the quotation marks from 'options'. I don't understand why this didn't produce an error message.
options = optimoptions('linprog','Algorithm','simplex')
[x,fval,exitflag,output,lambda]=linprog(f,A,b,Aeq,beq,[],[],[],options)
I also don't understand why the fact that you have f=[] doesn't produce an error message.
And how can I increase the iterations?
Use the 'MaxIter' option.
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!