Pb Genetic algorithm
Show older comments
Dear all,
I have a problem with the genetic algorithm in Matlab. I tried to create a custom function in order to save the "state" at each generation, but I have a lot of problems. By chance do you have an example of a code ?
Thank you very much,
Best regards,
Aymeric
Answers (2)
Alan Weiss
on 30 Aug 2011
0 votes
There is a thread on CSSM addressing this issue: http://www.mathworks.com/matlabcentral/newsreader/view_thread/311708#849624
To quote my own answer there:
You can certainly write an output function. The basic syntax is here: http://www.mathworks.com/help/releases/R2010b/toolbox/gads/f6174dfi10.html#f17837
(There is an error in the description of the syntax in the R2011a documentation, sorry, that's why I am pointing to R2010b.)
For examples of using an output function (albeit with a different syntax than ga uses), see http://www.mathworks.com/help/techdoc/math/bsgpq6p-23.html#bsgpq6q-31 http://www.mathworks.com/help/toolbox/optim/ug/brhkghv-56.html
Alan Weiss MATLAB mathematical toolbox documentation
aymeric
on 30 Aug 2011
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!