sample (with replacement) random integers all range included
2 views (last 30 days)
I want to create a vector X of n uniformly random integers from a range [0 m] without missing any of the numbers between 0 and m.
I want X to contain 10 integers with values 0, 1, 2, 3 and I want all of them to appear at least one time.
i.e. the following vector is not allowed: [3 3 0 1 1 0 3 1 1 0] because it doesn't contain the number "2" at least one time
Is there a matlab function doing that? or I have to create one?