Owning Class: statistics
Requires: MathScript RT Module
Syntax
r = random(type, a, b, c)
r = random(type, a, b, c, m)
r = random(type, a, b, c, n)
r = random(type, a, b, c, m, n)
r = random(type, a, b, c, [m, n])
Description
Generates random numbers according to a specified distribution. random(type, a, b, c) generates a single random number. random(type, a, b, c, m) and random(type, a, b, c, n) generate an m-by-m and n-by-n matrix, respectively. random(type, a, b, c, m, n) and random(type, a, b, c, [m, n]) generate an m-by-n matrix.
Examples
Inputs
| Name |
Description |
| type |
Specifies the type of distribution. type is a string that accepts the following values.
| 'beta' |
Specifies a beta distribution. LabVIEW also accepts 'Beta'. This distribution takes two parameters. |
| 'bino' |
Specifies a binomial distribution. LabVIEW also accepts 'Binomial'. This distribution takes two parameters. |
| 'chi2' |
Specifies a chi-squared distribution. LabVIEW also accepts 'Chisquare'. This distribution takes one parameter. |
| 'exp' |
Specifies an exponential distribution. LabVIEW also accepts 'Exponential'. This distribution takes one parameter. |
| 'f' |
Specifies an F distribution. LabVIEW also accepts 'F'. This distribution takes two parameters. |
| 'gam' |
Specifies a gamma distribution. LabVIEW also accepts 'Gamma'. This distribution takes two parameters. |
| 'geo' |
Specifies a geometric distribution. LabVIEW also accepts 'Geometric'. This distribution takes one parameter. |
| 'hyge' |
Specifies a hypergeometric distribution. LabVIEW also accepts 'Hypergeometric'. This distribution takes three parameters. |
| 'logn' |
Specifies a lognormal distribution. LabVIEW also accepts 'Lognormal'. This distribution takes two parameters. |
| 'nbin' |
Specifies a negative binomial distribution. LabVIEW also accepts 'Negative Binomial'. This distribution takes two parameters. |
| 'ncf' |
Specifies a noncentral F distribution. LabVIEW also accepts 'Noncentral F'. This distribution takes three parameters. |
| 'nct' |
Specifies a noncentral T distribution. LabVIEW also accepts 'Noncentral T'. This distribution takes two parameters. |
| 'ncx2' |
Specifies a noncentral chi-squared distribution. LabVIEW also accepts 'Noncentral Chisquare'. This distribution takes two parameters. |
| 'norm' |
Specifies a normal distribution. LabVIEW also accepts 'Normal'. This distribution takes two parameters. |
| 'poiss' |
Specifies a Poisson distribution. LabVIEW also accepts 'Poisson'. This distribution takes two parameters. |
| 'rayl' |
Specifies a Rayleigh distribution. LabVIEW also accepts 'Rayleigh'. This distribution takes one parameter. |
| 't' |
Specifies a T distribution. LabVIEW also accepts 'T'. This distribution takes one parameter. |
| 'unid' |
Specifies a discrete uniform distribution. LabVIEW also accepts 'Discrete Uniform'. This distribution takes one parameter. |
| 'unif' |
Specifies a continuous uniform distribution. LabVIEW also accepts 'Uniform'. This distribution takes two parameters. |
| 'weib' |
Specifies a Weibull distribution. LabVIEW also accepts 'weibull'. This distribution takes two parameters. |
|
| a |
Specifies a parameter for the distribution. a is a number or matrix. If a is a matrix, a must be of the size m-by-n. |
| b |
Specifies a parameter for the distribution. b is a number or matrix. If b is a matrix, b must be of the size m-by-n. |
| c |
Specifies a parameter for the distribution. c is a number or matrix. If c is a matrix, c must be of the size m-by-n. |
| m |
Specifies the number of rows in r. m is a positive integer. |
| n |
Specifies the number of columns in r. n is a positive integer. |
Outputs
| Name |
Description |
| r |
Returns an m-by-n matrix of random numbers with a type distribution. |
Examples
R = random('chi2', 3, 5, 6)
Related Topics
rand