Matlab求最小值问题,用linprog函数时出了点问题没做出来,高手给指点一下,给出程序,谢谢

2025-01-04 18:12:03
推荐回答(1个)
回答1:

f=[160 130 220 170 140 130 190 150 190 200 230];
Aeq=[1 1 1 1 0 0 0 0 0 0 0;0 0 0 0 1 1 1 1 0 0 0;0 0 0 0 0 0 0 0 1 1 1];
Beq=[50 60 50];
A=[0 0 0 -1 0 0 0 -1 0 0 0;0 0 0 1 0 0 0 1 0 0 0;-1 0 0 0 -1 0 0 0 -1 0 0;1 0 0 0 1 0 0 0 1 0 0;0 -1 0 0 0 -1 0 0 0 -1 0;0 1 0 0 0 1 0 0 0 1 0;...
0 0 -1 0 0 0 -1 0 0 0 -1;0 0 1 0 0 0 1 0 0 0 1;];
B=[-10 50 -30 80 -70 140 -10 30];
LB=[0 0 0 0 0 0 0 0 0 0 0];

[X,fval,exitflag,output,lambada]=linprog(f,A,B,Aeq,Beq,LB)
Optimization terminated successfully.

X =

0.0000
50.0000
0.0000
0.0000
0.0000
50.0000
0.0000
10.0000
40.0000
0.0000
10.0000

fval =

2.4400e+004