FreeMat
RANDPERM Random permutation

Section: Random Number Generation

USAGE

   y = randperm(n)

y is a random permutation of integers from 1 to n. randperm calls rand and changes its state.

Example

--> y = randperm(10)

y = 
  2  5 10  8  1  6  3  7  9  4