clear ; close all ; clc
N = 30;
R = 10*rand(1,N);
for startMove = 1:N -1
    for pos = 1:N-startMove
        if R(pos) > R(pos+1)
            R([pos,pos+1]) = R([pos+1,pos]);
        end
        figure(1) ;
        plot(R,'*','LineWidth',2);
        pause(0.01);
    end
end
issorted(R)