Learn R Programming

pracma (version 0.7.5)

randperm: Random Permutation

Description

Generates a random permutation.

Usage

randperm(a)

Arguments

a
numeric vector of some length n

Value

  • vector of permuted elements of a

Details

Generates one random permutation of the elements a.

See Also

perms

Examples

Run this code
randperm(6)
randperm(1:6)
randperm(seq(2, 10, by=2))

Run the code above in your browser using DataLab