由matlab中的函数linprog求解最优化问题时能否输出所有的迭代点,而不只是最后的结果

来源:百度知道 编辑:UC知道 时间:2024/06/05 03:18:38
各位大侠高手,我先在这里谢谢了

可以的啦。例如

f = [-5; -4; -6]
A = [1 -1 1
3 2 4
3 2 0];
b = [20; 42; 30];
lb = zeros(3,1);
options = optimset('Display','iter','TolFun',1e-8);
[x,fval,exitflag,output,lambda] = linprog(f,A,b,[],[],lb,[],[],options)

结果:
f =

-5
-4
-6

Residuals: Primal Dual Duality Total
Infeas Infeas Gap Rel
A*x-b A'*y+z-f x'*z Error
---------------------------------------------------
Iter 0: 1.13e+003 1.87e+001 2.62e+003 1.50e+003
Iter 1: 1.64e+002 2.05e-015 4.34e+002 2.96e+000
Iter 2: 2.95e-014 2.00e-015 7.92e+001 5.41e-001
Iter 3: 5.02e-015 8.24e-015 7.70e+000 9.50e-002
Iter 4: 7.79e-012 2.19e-015 7.74e-001 9.84e-003
Iter 5: 4.16e-014 1.56e-015 2.01e-004 2.57e-006
Iter 6: 1.00e-014 1.78e-015