Statistics Toolbox
  Go to function:
    Search    Help Desk 
binornd    Examples

Random numbers from the binomial distribution.

Syntax

Description

R = binornd(N,P) generates binomial random numbers with parameters N and P. The size of R is the common size of N and P if both are matrices . If either parameter is a scalar, the size of R is the size of the other.

R = binornd(N,P,mm) generates binomial random numbers with parameters N and P. mm is a 1-by-2 vector that contains the row and column dimensions of R.

R = binornd(N,p,mm,nn) generates binomial random numbers with parameters N and P. The scalars mm and nn are the row and column dimensions of R.

Algorithm

The binornd function uses the direct method using the definition of the binomial distribution as a sum of Bernoulli random variables.

Examples



[ Previous | Help Desk | Next ]