Avoiding too many figures from loop in GA Toolbox
Mostrar comentarios más antiguos
I am creating a function which looks like this:
function F = fitnessfun(x)
...
score = x1+x2+x3
...
figure('Color',[1 1 1],'position', [500, 250, 640, 480]);
imagesc(score);
title(['Score: ', num2str(score)],'Fontsize',24);
Now, when I run this function in Genetic Algorithm toolbox, i.e. I call @fitnessfun from the Optimtoolbox, everything runs smoothly, except the script making a new figure window for each GA generation. Tried to prevent this by using classical trick:
figure('Color',[1 1 1],'position', [500, 250, 640, 480]);
hold on
imagesc(score);
title(['Score: ', num2str(score)],'Fontsize',24);
hold off
But that does NOT help, new figure windows are created until termination (e.g. 500th generation) and causing my PC to crash.
Any solution to close the figure window automatically everytime a new figure is opened?
Thanks in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Environment and Settings en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!