y = randsample(n, k)
y = randsample(population, k)
y = randsample(..., replacement)
y = randsample(population, k, true, w)
randsample samples values using Nelson's random generator. Weighted sampling is supported with replacement.
rng(10);
y = randsample(10, 4)
population = [10 20 30];
w = [0 0 1];
y = randsample(population, 5, true, w)