求解max=4000x+3000y s.t.2x+y

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 02:46:48

求解max=4000x+3000y s.t.2x+y
求解max=4000x+3000y s.t.2x+y

求解max=4000x+3000y s.t.2x+y
如下:
代码:
f=[-4000 -3000];
A=[2 1; 1 1;0 1];
b=[10;8;7];
lb=[];ub=[];
[x,fval,exitflag,output]=linprog(f,A,b,[],[],lb,ub)
结果:
x =
2.0000
6.0000
fval =
-2.6000e+004
exitflag =
1
output =
iterations:5
algorithm:'large-scale:interior point'
cgiterations:0
message:'Optimization terminated.'
constrviolation:0
firstorderopt:2.3088e-005