Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

randn

Generates a matrix with normal distributed random values. In probability theory, the normal (or Gaussian) distribution is a continuous probability distribution, defined on the entire real line, that has a bell-shaped probability density function, known as the Gaussian function or informally as the bell curve.

References

randn()

Generates one normally (gaussian) distributed random value around 0 with standard deviation 1.

Returns 1. entry

Scalar

randn(dim)

Generates a n-by-n matrix with normally (gaussian) distributed random value around 0 with standard deviation 1.

Argument dim

Scalar

Returns 1. entry

Matrix

Example

randn(3)

Gives a 3x3 matrix with normally dist. rand. values.

randn(rows,cols)

Generates a m-by-n matrix with normally (gaussian) distributed random value around 0 with standard deviation 1.

Argument rows

Scalar

Argument cols

Scalar

Returns 1. entry

Matrix

Example

randn(3, 1)

Gives a 3x1 matrix with normally dist. rand. values.

randn(rows,cols,mu,sigma)

Generates a m-by-n matrix with normally (gaussian) distributed random value around mu with standard deviation sigma.

Argument rows

Scalar

Argument cols

Scalar

Argument mu

Scalar

Argument sigma

Scalar

Returns 1. entry

Matrix

Example

randn(3, 1, 10, 2.5)

Gives a 3x1 matrix with normally dist. rand. values around 10 with standard deviation sigma.

Clone this wiki locally