[TOC]

randn

Pseudo-random number following the standard normal distribution

Usages

randn

randn(n)

randn(s1,s2,...,sN)

randn(sizeVec)

Examples

Input
% Vector of numbers from normal distribution with mean equal to 1 and SD equal to 2.
r = 2 * randn(1,100000) + 1;
% Mean estimated from r.
mean(r)
% Standard deviation estimated from r.
sqrt(mean((1-r).^2))
Output
ans = 1e-1 × 
 9.9262

ans = 
 2.0067

Discussion