MATLAB线性规划,Y=2X1+X2,X1+X2<=2,X1>=0,X2>=0,求解

2024-12-27 15:28:24
推荐回答(1个)
回答1:

>> f=[2;1];A=[1 1];b=2;Aeq=[ ];beq=[];lb=[0 0];ub=[];
[X,FVAL,EXITFLAG] = linprog(f,A,b,Aeq,beq,lb,ub)

Optimization terminated.
X =
1.0e-08 *

0.1105
0.1177

FVAL =
3.3871e-09

EXITFLAG =
1