Generates random data from the log-normal probability distribution. There are two forms. |
||
Syntax |
RND = LogNormRnd(Mu, Sigma, Rows, Cols, Seed, State) RND = LogNormRnd(Mu, Sigma, Seed, State) |
|
Arguments |
Name |
Description |
Mu |
Mean of the log of the distribution. A scalar, vector or matrix. |
|
Sigma |
Standard deviation of the log of the distribution. A scalar, vector or matrix of positive values. |
|
Rows (optional) |
Number of output rows. A positive integer. Only valid when Mu and Sigma are scalars. |
|
Cols (optional) |
Number of output columns. A positive integer. Only valid when Mu and Sigma are scalars. |
|
Seed (optional) |
The seed to initialize the random number generator. A positive integer. See Comments below. |
|
State (optional) |
Set to "discard" if the state of the pseudo random number is not to be retained for future use. The default is "retain". |
|
Outputs |
Name |
Description |
RND |
Random numbers from the log-normal distribution. Its dimensions are determined by the input arguments. See Comments below. |
|
Example 1 |
Generate two random numbers from the log-normal distribution with (Mu, sigma) pairs of (2, 5) and (4, 3) respectively, with a random seed of 2003 |
|
Syntax |
||
rnd = LogNormRnd([2,4],[5,3],2003) |
||
Results |
||
rnd = 6.6631 8.908 |
||
Example 2 |
Generate a 1x4 vector of random numbers from the log-normal distribution with a = 2 and b = 5, and a random seed of 2003. |
|
Syntax |
||
rnd = LogNormRnd(2,5,1,4,2003) |
||
Results |
||
rnd = 6.6631 1268.1 0.35996 1.0988e+005 |
||
Comments |
Mu and Sigma must be the same size. If the optional size inputs are omitted, the size of the output is solely determined by the size of the two inputs Mu and Sigma. Each entry in the output uses the corresponding entries in the two inputs. If the optional size inputs are provided, both must be supplied. In that case, Mu and Sigma must be scalars and the size of the output is determined by Rows and Cols. That is, the inputs Mu and Sigma are used for each element of the output. The Seed can be any number. Using a seed allows a random sequence to be repeated. |
|
See Also: |