random(p) --- return a random reordering of the elements of p
0001 function q = random(p) 0002 % random(p) --- return a random reordering of the elements of p 0003 a = randperm(length(p)); 0004 q = permutation(a);