linprog gives wrong solution?
이전 댓글 표시
Hi
I am trying to solve a simple linear programming problem in matlab:
500x + 400y -> min
x + y >= 90
0.02x + 0.05y <= 2.7
3x + 5y <= 360
According to the manual this should solve the problem:
f = [500, 400];
A = [-1 -1; 0.02 0.05 3 5];
b = [-90 0.03*90 4*90]';
[x, fval, info] = linprog(f, A, b)
I received the answer:
x=[60 30];
fval = 4.20e4;
info=1
On the other hand, the vertices of the area of acceptable solutions and the value of the function are as follows:
xy=[60 30; 90 18; 45 45]
f = 1e4*[4.2000 5.2200 4.0500]
It looks like the actual minimum is 4.05e4. What am I doing wrong? How to interpret this result?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!