How to pass input parameter in a function handle
Mostrar comentarios más antiguos
I don't know what it is really called so maybe the title of my question can be misleading. Anyway, I am using simulated annealing and I initially set the options as follows
options = saoptimset('DataType', 'custom', 'AnnealingFcn', @PermuteElements, ...
'StallIterLimit',50, 'ReannealInterval',50, 'PlotInterval', 50, 'AcceptanceFcn', @acceptancesa);
then I called simulated annealing with these options and it works fine.
The problem is that I want to have some input parameters for the function PermuteElements(param1,param2,etc) which I will need inside the function. but when I add them in the options
options = saoptimset(..., @PermuteElements(param1,param2,etc), ...);
I get an error. I don't exactly understand the role of the @ in front of the function. So how should I input the parameters to the function? Also, how can I figure out when (and by which function) will the function I made exactly be called during simulated annealing execution?
Respuesta aceptada
Más respuestas (1)
the cyclist
el 13 de Jun. de 2016
0 votos
1 comentario
etudiant_is
el 13 de Jun. de 2016
Editada: etudiant_is
el 13 de Jun. de 2016
Categorías
Más información sobre Simulated Annealing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!