[TOC]

normrnd

Generating random number with normal distribution

Usages

normrnd(mu, sigma)

normrnd(mu, sigma, m)

normrnd(mu, sigma, s1, s2,..., sn)

normrnd(mu, sigma, sizeVec)

Discussions

Examples

Input
% Vector of 100,000 numbers from normal distribution with mean equal to 1 and SD equal to 2.
r = normrnd(1, 2, 1, 100000);
% Mean estimated from r.
mean(r)
% Standard deviation estimated from r.
sqrt(mean((1-r).^2))
Output
ans = 
 1.0011

ans = 
 2.0023