MATLAB Function Reference Previous page   Next Page
randperm

Random permutation

Syntax

Description

p = randperm(n) returns a random permutation of the integers 1:n.

Remarks

The randperm function calls rand and therefore changes rand's state.

Examples

randperm(6) might be the vector

or it might be some other permutation of 1:6.

See Also

permute


Previous page  randn rank Next page

© 1994-2005 The MathWorks, Inc.