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 = 2 5 10 8 1 6 3 7 9 4