Genetic Algorithm - Plotting fitness values
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Seth DeLand
2013년 3월 11일
PlotFcns needs to be passed in as an option for ga:
problem.options.PlotFcns = @gaplotbestf;
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!