MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB工具箱] fminunc 使用trust region 算法的问题 (https://www.labfans.com/bbs/showthread.php?t=14409)

loveyoudx 2012-03-15 11:13

fminunc 使用trust region 算法的问题
 
我m-file里写的是
function y=obj2(x)
% a function of 20 variables
%

temp=0;
for i=1:20
temp=temp+x(i)^2;
end

y=temp;
end

我想用trust region 来求最小值,但是在fminunc需要我提供gradient function, 对上面的function我应该怎么给他的gradient?谢谢!


所有时间均为北京时间。现在的时间是 15:58

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.