Section: Random Number Generation
y = randperm(n)
y is a random permutation of integers from 1 to n. randperm calls rand and changes its state.
y
n
randperm
rand
--> y = randperm(10) y = 4 9 6 3 10 7 2 8 1 5