Problem While Doing Libprog (Problem is unbounded)
이전 댓글 표시
Hey guys, I was trying to write a code to solve for a problem of 9 variables but with 4 constraints. Here's the code:
A=[1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
0.1 0.1 0.4 0.6 0.3 0.3 0.3 0.5 0.2
0.1 0.3 0.5 0.3 0.3 0.4 0.2 0.4 0.3
0.8 0.6 0.1 0.1 0.4 0.3 0.5 0.1 0.5];
B=[1 0.3 0.3 0.4];
Z=[4.1 4.3 5.8 6.0 7.6 7.5 7.3 6.9 7.3];
[x,fval] = linprog(Z,A,B);
I need to get the final value of the problem which the problem needs to be minimize.
댓글 수: 1
Torsten
2022년 5월 18일
The problem is unbounded.
Maybe you forgot to set x(i) >= 0 (i=1,...,9) as a constraint in "lb" ?
채택된 답변
추가 답변 (1개)
Loke Yan Kuang
2022년 5월 18일
0 개 추천
댓글 수: 1
Torsten
2022년 5월 18일
You put A, b at the wrong position in the call to "linprog".
카테고리
도움말 센터 및 File Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!