Function Reference
— Function File: discrete_rnd (n, v, p)
— Function File: discrete_rnd (v, p, r, c)
— Function File: discrete_rnd (v, p, sz)

Generate a row vector containing a random sample of size n from the univariate distribution which assumes the values in v with probabilities p. n must be a scalar.

If r and c are given create a matrix with r rows and c columns. Or if sz is a vector, create a matrix of size sz.