Error working with saoptmset OutputFcns

I am trying to construct history for my objective function in the a simulated annealing algorithm. I am working according to the example suggested in the "Wriing output function" link: http://se.mathworks.com/help/optim/ug/output-functions.html, I have my option for saoptimset as
options = saoptimset('MaxFunEvals', 10000, 'InitialTemperature', 10000, 'OutputFcns', @outfun);
and the way i call the algorithm is
xsol=simulannealbnd(@COST_function,x0,lb,ub, options);
and I follow the same as in example for the outfunc except my objective function which I have defined in the @cost_function. I get a long list of errors starting with too many input arguments and so on. I am unable to find a example to read through for this. Any suggestions and help are appreciated. Thanks.

回答(1 个)

Alan Weiss
Alan Weiss 2016-6-23
The syntax for a simulannealbnd output function differs from that of an Optimization Toolbox™ output function. See the simulated annealing output function syntax here.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

帮助中心File Exchange 中查找有关 Simulated Annealing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by