FUNCTION REFERENCE
randn
Normally distributed random numbers.
Normally distributed random numbers.
Syntax
randn()Syntax
randn(n)Syntax
randn(m, n)Syntax
randn([m n])Returns double values from a standard normal distribution. Sizes follow rand: no size gives a scalar and one scalar size gives a square matrix. Values fill columns first and share the session generator with rand and randi. Use rng to set the seed. An optional 'double' class is accepted; higher dimensions must be singleton, and sizes must fit the matrix and statement limits.
Example
rng(0); randn(1,3) % [0.537667 1.833885 -2.258847]Differences from MATLAB: Seeded normal values differ; do not expect identical MATLAB sequences. Other output classes and legacy generator-state forms are not supported.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.