MATLAB: About termination of genetic algorithm

generationsgenetic algorithmGlobal Optimization ToolboxMATLABtermination

I have set the options of the ga as shown:
options=gaoptimset(options,'Generations',100);
The algorithm terminates after 6 generations. I would like to ask how i will make the algorithm terminate at 100th generation. Thank you in advance.

Best Answer

ga would normally not exit until at least 50 generations. Therefore, either you have nonlinear constraints, or your options are not what you say they are.
Can you please show us your real options settings (the line you gave assumes that some options have already been created), your real function call, and your real output?
Alan Weiss
MATLAB mathematical toolbox documentation