RANDEXP Generate Exponential Random Variable

Section: Random Number Generation


Generates a vector of exponential random variables with the specified parameter. The general syntax for its use is
   y = randexp(lambda)

where lambda is a vector containing the parameters for the generated random variables.

Function Internals

The exponential random variable is usually associated with the waiting time between events in a Poisson random process. The PDF of an exponential random variable is:


Here is an example of using the randexp function to generate some exponentially distributed random variables
--> randexp(ones(1,6))

ans = 
    0.0608    0.0019    1.1266    0.2012    0.5079    3.4205