max f (x1, x2)=x1x2+3sub.to
x1+x2-2=0解:化成标准形式:sub.to
x1+x2=2在Matlab中实现如下:>>H=[0,-1;-1,0];>>f=[0;0];>>Aeq=[1 1];>>b=2;>>[x,fval,exitflag,output,lambda] = quadprog(H,f,[ ],[ ],Aeq,b)结果为:x =
1.0000
1.0000fval = -1.0000exitflag =
1output =
firstorderopt: 0
ite...
|