How to pass input parameter in a function handle
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (1)
the cyclist
il 13 Giu 2016
0 voti
1 Commento
etudiant_is
il 13 Giu 2016
Modificato: etudiant_is
il 13 Giu 2016
Categorie
Scopri di più su Simulated Annealing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!