Previous Up Next

2.10.1  Random permutation : randperm

randperm takes as argument an integer n.
randperm returns a random permutation of [0..n−1].
Input :

randperm(3)

Output :

[2,0,1]

Previous Up Next