How to break the infeasibility of solution for the function linprog?

조회 수: 2 (최근 30일)
Gustave X
Gustave X 2023년 1월 8일
댓글: Gustave X 2023년 1월 10일
Hello everyone,
I'm working on some heuristic algorithm wich has to return to choose another random initial state and run again.
Inside I loop while I have to solve at each iteration a linear programming by using the functon linprog.
How can I break the programme and return it to the initial state choice when there is no feasible solution to the linear programming problem without stopping the whole program?.
Thank you.
  댓글 수: 2
Torsten
Torsten 2023년 1월 8일
Can't you choose how to proceed depending on the linprog exitflag ?
Gustave X
Gustave X 2023년 1월 8일
sorry but I'm a new user of matlab. However, I know that the error is because of infeasibility reason. I read this https://fr.mathworks.com/help/optim/ug/linprog.html#buusznx-exitflag
but I don't know how to implement it on the program.
Thank you in advance.

댓글을 달려면 로그인하십시오.

채택된 답변

Torsten
Torsten 2023년 1월 8일
이동: Matt J 2023년 1월 8일
[x,fval,exitflag,output] = linprog(___)
if exitflag > 0 % linprog was successful
take action 1
else % linprog was not successful
take action 2
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by