Generates random data from the Weibull probability distribution. There are two forms. |
||
Syntax |
RND = WeibullRnd(a, b, Rows, Cols, Seed, State) RND = WeibullRnd(a, b, Seed, State) |
|
Arguments |
Name |
Description |
a |
The scale parameter. A scalar, vector or matrix of positive values. |
|
b |
The shape parameter. A scalar, vector or matrix of positive values. |
|
Rows (optional) |
Number of output rows. A positive integer. Only valid when a and b are scalars. |
|
Cols (optional) |
Number of output columns. A positive integer. Only valid when a and b are scalars. |
|
Seed (optional) |
The seed to initialize the random number generator. An 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 Weibull distribution. Its dimensions are determined by the input arguments. See Comments below. |
|
Example 1 |
Generate two random numbers from the Weibull distribution with (a,b) pairs of (2,5) and (4,3) respectively, with a random seed of 2003. |
|
Syntax |
||
rnd = WeibullRnd([2,4],[5,3],2003) |
||
Results |
||
rnd = 1.8669 1.9934 |
||
Example 2 |
Generate a 1x4 vector of random numbers from the Weibull distribution with a = 2 and |
|
Syntax |
||
rnd = WeibullRnd(2,5,1,4,2003) |
||
Results |
||
rnd = 1.8669 1.3169 1.9167 1.6618 |
||
Comments |
a and b 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 a and b. 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, a and b must be scalars and the size of the output is determined by Rows and Cols. That is, the inputs a and b are used for each element of the output. |
||
The Seed can be any number. Using a seed allows a random sequence to be repeated. |
||
The Weibull distribution does not have a standard parameterization. The form used here has the following PDF: f(x) = (b/a) * (x/a)^(b-1) * e^[-(x/a)^b] |
||
See Also: |