MATLAB Answers

0

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

Asked by Saket Adhikari on 24 Jun 2017
Latest activity Edited by John D'Errico
on 25 Jun 2017
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??

  0 Comments

Sign in to comment.

1 Answer

Answer by John D'Errico
on 25 Jun 2017
Edited by John D'Errico
on 25 Jun 2017

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.

  0 Comments

Sign in to comment.