我的MATLAB不支持 optimoptions
。
如何使用 optimset
重写以下例程,以便产生相同的结果?
options = optimoptions('fminunc','Display','off','OutputFcn',
@bananaout,'Algorithm','quasi-newton');
[x,fval,eflag,output] = fminunc(fun,x0,options);
title 'Rosenbrock solution via fminunc'
Fcount = output.funcCount;
disp(['Number of function evaluations for fminunc was ',num2str(Fcount)])
disp(['Number of solver iterations for fminunc was ',num2str(output.iterations)])