Intlinprog function - problem
显示 更早的评论
I want to solve a math problem that give me a minimal value of a function. The function of the objective is:
min 64x1+40x2
The invariants are:
3x1+5x2≤150
8X1+5X2≤300
0X1+1X2≤20
I wrote the code in Matlab:
f=-[64;40]; intcon = [1;2]; A=[3,5;8,5;0,1]; B=[150;300;20];
[x,fval] = intlinprog(f,intcon,A,B,[],[],lb)
When I run this code, I get the results:
x =
30.0000
12.0000
fval =
-2.4000e+03
And this results are ok, but when I changes the value of the objective function from 64 to 64.01, I get the strongly changed values of X:
x =
35.0000
4.0000
fval =
-2.4003e+03
I would like to know why the value of x varies so much.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 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!