Statistics Toolbox
  Go to function:
    Search    Help Desk 
unidrnd    Examples

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 size of R is the size of N.

R = unidrnd(N,mm) generates discrete uniform random numbers with maximum, N. 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. The scalars mm and nn are the row and column dimensions of R.

The parameter, N, must have positive integer elements.

Examples

In the Massachusetts lottery a player chooses a four digit number. Generate random numbers for Monday through Saturday.



[ Previous | Help Desk | Next ]