poissrnd

Generate random data from a Poisson distribution.

Syntax

rnd=poissrnd(lambda)

rnd=poissrnd(lambda,r,c)

Inputs

lambda
Mean.
Type: double
Dimension: scalar | vector | matrix
r,c
Number of matrix rows and columns.
Type: integer
Dimension: scalar

Outputs

rnd
Random data.

Examples

Single value poissrnd example:

lambda = 5;
rnd = poissrnd(lambda)
rnd = 11
Vector poissrnd example:
lambda = 5;
r = 1;
c = 5;
rnd = poissrnd(lambda,r,c)
rnd = [Matrix] 1 x 5
11 3 8 5 2

Comments

The random number generator can be initialized using rand.