randperm

Purpose

Random permutation.

Synopsis

p = randperm(n)

Description

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

Examples

randperm(6) might be the vector

[3  2  6  4  1  5]
or it might be some other permutation of 1:6.

See Also

rand, sprandn

(c) Copyright 1994 by The MathWorks, Inc.