% visualizing the result of repeated shuffles n = 1000; x = 1:n; for k=0:10 plot(1:n, x, '.') axis('square') title(['Number of shuffles = ', int2str(k)]); pause(3); x = shuffle(x); end;