I am trying to plot figures that have a point inside it. I want to add a new point to the figure at each 10 steps (or any constant rate).For example, if I have 50 steps then I should have 50 figures. Figures from 1 to 10 will have one point, figures from 11 to 20 will have two points, and figures from 21 to 30 will have three points, and so on. I did that in the below code  but, unfortunately, it gave me only one point for all figures. 
clc;
clear;
Current_Path=pwd;
cd (Current_Path)
mkdir('Photos','part1')
pridir = 'Photos\part';
R=rand(1,50);
Y=rand(1,50);
for i=1:50
    figure
    for jj = 1:floor((i-1)/10)+1
        if jj<=1
            plot (R(i),Y(i),'*r');
            printto = sprintf('%s%d\\Motion%03d',pridir,1,i);
            print('-djpeg90',printto)
            close(gcf);
            hold on
        else
            R(i)=R(i-((jj-1)*10));
            Y(i)=Y(i-((jj-1)*10));
            plot (R(i),Y(i),'*r');
            printto = sprintf('%s%d\\Motion%03d',pridir,1,i);
            print('-djpeg90',printto)
            close(gcf);
            hold on
        end
    end
    hold off
end
 
     
    