main.m607 chars21 lines
Make sure to replace your_fitness_function with your actual fitness function, and number_of_variables and number_of_constraints with the appropriate values for your problem. The PlotFcn option is set to @gaplotbestf to plot the best fitness value at each iteration. The optimization figure of fitness value and number of iterations will be displayed in separate figures.
gistlibby LogSnag