Genetic Algorithm - Plotting fitness values

2 visualizaciones (últimos 30 días)
PJ
PJ el 10 de Mzo. de 2013
Hello,
I'm running a genetic algorithm in Matlab with [x,fval]=ga(gaproblem)
This all works fine and I get nice results. Now I wish to plot the best fitness function value at each generation; according to the user manual it should be as simple as setting
gaproblem.PlotFcns=@gaplotbestf;
This however produces no result, I get no figure. As far as I understand @gaplotbestf is built in, and there should be no need to define it, or am I getting it wrong?
It would be nice if someone could help.

Respuesta aceptada

Seth DeLand
Seth DeLand el 11 de Mzo. de 2013
PlotFcns needs to be passed in as an option for ga:
problem.options.PlotFcns = @gaplotbestf;

Más respuestas (0)

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by