Examples

randperm(6)

might be the vector

[3 2 6 4 1 5]

or
it might be some other permutation of the integers from 1 to 6, depending
on the state of the random number generator. Two successive calls
to randperm would in most cases return two different
vectors:

randperm(6)
ans =
5 2 6 4 1 3
randperm(6)
ans =
4 1 6 2 3 5

randperm(6,3)

might be the
vector

[4 2 5]

or it might be some
other permutation of any three integers from 1 to 6 inclusive, depending
on the state of the random number generator.