I am very new to MATLAB and programming in general, so please bear with my syntax/poor code.
I am trying to make an animation for my project in an introductory MATLAB class. I want to show how different sorts "look" as they are being processed. I have the script doing what I want, but I can't get it to stop opening new figure windows for each loop pass. This results in hundreds of windows being opened.
Here is the bubble sort for example.
Ba=input('Array to be sorted: ')
saveas(gcf, sprintf('name%d', counter1), 'bmp');
It saves the images to be made into an animation later, but it is very slow as it opens hundreds of windows.