output function for ga
Mostrar comentarios más antiguos
I have a question regarding Matlab GA output. I run my GA for a certain number of iterations and in each iteration it minimizes a function which has nested loops. For the outputs I only get the history of i (iteration), x (parameter that leads to the minimum result), and fval-(minimum value). Is there a way that I can store the value of other variables (all of the other variables) at the end of each GA iteration? I tried to use output functions but was not able to do so.
Thanks, Ali
Respuestas (1)
Alan Weiss
el 8 de Jul. de 2015
Editada: Alan Weiss
el 8 de Jul. de 2015
An output function only runs at the end of an iteration, and has access to variables described in the State Structure. To log other variables in your calculation, you have a number of alternatives available, described in Share Data Between Workspaces. You can log data for any of your functions by, say, having the functions append to a global variable in the base workspace, such as
global logvariable
% more calculations here
logvariable = [logvariable;newdata];
Alan Weiss
MATLAB mathematical toolbox documentation
Categorías
Más información sobre Genetic Algorithm 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!