Navigation

Operators and Keywords

Function List:

C++ API

: randn (n)
: randn (m, n, …)
: randn ([m n …])
: v = randn ("state")
: randn ("state", v)
: randn ("state", "reset")
: v = randn ("seed")
: randn ("seed", v)
: randn ("seed", "reset")
: randn (…, "single")
: randn (…, "double")

Return a matrix with normally distributed random elements having zero mean and variance one.

The arguments are handled the same as the arguments for rand.

By default, randn uses the Marsaglia and Tsang “Ziggurat technique” to transform from a uniform to a normal distribution.

The class of the value returned can be controlled by a trailing "double" or "single" argument. These are the only valid classes.

Reference: G. Marsaglia and W.W. Tsang, Ziggurat Method for Generating Random Variables, J. Statistical Software, vol 5, 2000, http://www.jstatsoft.org/v05/i08/

See also: rand, rande, randg, randp.

Package: octave