exprnd

Generate random data from an exponential distribution.

Syntax

rnd=exprnd(lambda)

rnd=exprnd(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 exprnd example:

lambda = 5;
rnd = exprnd(lambda)
rnd = 3
Vector exprnd example:
lambda = 5;
r = 1;
c = 5;
rnd = exprnd(lambda,r,c)
rnd = [Matrix] 1 x 5
3 2.6141 1.676 0.84644 2.5312

Comments

The random number generator can be initialized using rand.