how do i increase the maximum number of iterations for linprog?

조회 수: 5 (최근 30일)
Saket Adhikari
Saket Adhikari 2017년 6월 24일
편집: John D'Errico 2017년 6월 25일
Since it says to increase options.MaxIter. I did:
OPTIONS=optimset('MaxIter',10000);
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA]=linprog(c,A,b,Aeq,beq,LB,UB,OPTIONS)
Then i get erros message as:
Error using linprog (line 144)
LINPROG requires the following inputs to be of data type double: 'X0'.
Error in main_compositeSystem (line 134)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA]=linprog(c,A,b,Aeq,beq,LB,UB,OPTIONS);%,OPTIONS.MaxIter);
Turns out, linprog doesnot allow to set options??

답변 (1개)

John D'Errico
John D'Errico 2017년 6월 25일
편집: John D'Errico 2017년 6월 25일
Linprog DOES allow you to set options if you pass them in properly.
READ THE ERROR MESSAGE.
linprog has a problem with the variable X0, or what you passed in as X0.
The argument list for linprog expects X0 as the next argument after UB to be X0.
You passed in a structure in that argument.
If you don't intend to pass in a variable, such as X0, then pass in an empty array [] as a placeholder.

Community Treasure Hunt

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

Start Hunting!

Translated by