Previous Up Next

6.11.1  Permutation aléatoire : randperm

randperm a comme argument un entier n.
randperm renvoie une permutation aléatoire de [0..n−1].
On tape :

randperm(3)

On obtient :

[2,0,1]

Previous Up Next