| MATLAB Function Reference | ![]() |
p = randperm(n)
p = randperm(n) returns a random permutation of the integers 1:n.
The randperm function calls rand and therefore, changes rand's state.
randperm(6) might be the vector
[3 2 6 4 1 5]
or it might be some other permutation of 1:6.
![]() | randn | rank | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |