MATLAB:特定约束条件下的最优化问题

2024-12-30 20:26:28
推荐回答(2个)
回答1:

写了一下,是下面的结果,应该是对的,呵呵!

>> f=[25;30];
A=[2 3;3 4];
b=[69;48];
lb=[4;2];
[x,fval,exitflag,output]=linprog(f,[],[],A,b)
Optimization terminated.

x =

-132.0000
111.0000

fval =

30.0000

exitflag =

1

output =

iterations: 4
algorithm: 'large-scale: interior point'
cgiterations: 0
message: 'Optimization terminated.'
constrviolation: 6.7928e-011

回答2:

线性规划问题用linprog求解