Statistics Toolbox | ![]() ![]() |
Random numbers from the discrete uniform distribution
Syntax
Description
The discrete uniform distribution arises from experiments equivalent to drawing a number from one to N out of a hat.
R = unidrnd(N)
generates discrete uniform random numbers with maximum N
. The parameters in N must be positive integers. The size of R is the size of N.
R = unidrnd(N,mm)
generates discrete uniform random numbers with maximum N, where mm is a 1-by-2 vector that contains the row and column dimensions of R.
R = unidrnd(N,mm,nn)
generates discrete uniform random numbers with maximum N, where scalars mm and nn are the row and column dimensions of R.
Examples
In the Massachusetts lottery, a player chooses a four digit number. Generate random numbers for Monday through Saturday.
See Also
unidcdf
, unidinv
, unidpdf
, unidstat
![]() | unidpdf | unidstat | ![]() |