Normal random numbers
generates an array of normal random numbers, where r
= normrnd(mu
,sigma
,sz1,...,szN
)sz1,...,szN
indicates the size of each dimension.
normrnd
is a function specific to normal
distribution. Statistics and Machine Learning Toolbox™ also offers the generic function random
, which supports various
probability distributions. To use random
, create a
NormalDistribution
probability
distribution object and pass the object as an input argument or specify the
probability distribution name and its parameters. Note that the
distribution-specific function normrnd
is faster
than the generic function random
.
Use randn
to generate random
numbers from the standard normal distribution.
To generate random numbers interactively, use randtool
, a user interface for random number generation.
[1] Marsaglia, G, and W. W. Tsang. “A Fast, Easily Implemented Method for Sampling from Decreasing or Symmetric Unimodal Density Functions.” SIAM Journal on Scientific and Statistical Computing. Vol. 5, Number 2, 1984, pp. 349–359.
[2] Evans, M., N. Hastings, and B. Peacock. Statistical Distributions. 2nd ed. Hoboken, NJ: John Wiley & Sons, Inc., 1993.