MATLAB: How to plot the best individual fitness in GA

genetic algorithmoptimizationplot

I would like to ask if there is a way to plot the best individual fitness value instead of its score vs the generation number, when using the GA with integer and non-linear constraints.

Best Answer

You can use an output function or plot function to plot anything you want. See this example of a custom plot function in ga and the details of the plot function syntax and State Structure. The state.Population field contains the current population, and you can compute the fitness value for members of the population within the plot function.
Alan Weiss
MATLAB mathematical toolbox documentation