next up previous contents
Next: RANDP Generate Poisson Random Up: Random Number Generation Previous: RANDCHI Generate Chi-Square Random   Contents

Subsections

RANDEXP Generate Exponential Random Variable

Usage

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:

$\displaystyle f(x) = \lambda e^{-\lambda x}
$

Example

Here is an example of using the randexp function to generate some exponentially distributed random variables

--> randexp(ones(1,6))
ans = 
  <float>  - size: [1 6]
 
Columns 1 to 3
    0.98798931         0.99071515         0.79986471      
 
Columns 4 to 6
    0.13242233         0.64143968         0.99512565



Samit K. Basu 2005-03-16