1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>RANDEXP Generate Exponential Random Variable
</TITLE>
</HEAD>
<BODY>
<H2>RANDEXP Generate Exponential Random Variable
</H2>
<P>
Section: <A HREF=sec_random.html> Random Number Generation </A>
<H3>Usage</H3>
Generates a vector of exponential random variables with
the specified parameter. The general syntax for its use is
<PRE>
y = randexp(lambda)
</PRE>
<P>
where <code>lambda</code> is a vector containing the parameters for
the generated random variables.
<H3>Function Internals</H3>
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:
<P>
<DIV ALIGN="CENTER">
<IMG SRC="randexp_eqn1.png">
</DIV>
<P>
<H3>Example</H3>
Here is an example of using the <code>randexp</code> function to generate
some exponentially distributed random variables
<PRE>
--> randexp(ones(1,6))
ans =
0.0608 0.0019 1.1266 0.2012 0.5079 3.4205
</PRE>
<P>
</BODY>
</HTML>
|