normrndGenerating random number with normal distribution
normrnd(mu, sigma)mu and sigma, respectively.mu and sigma should be arrays with the same sizes, or one of them should be scalar.sigma should contain non-negative numbers.normrnd(mu, sigma, m)m-by-m array containing pseudo-random numbers of normal distributions with means and standard deviations given by mu and sigma, respectively.mu and sigma should be a scalar or should have size [m, m].mu or sigma is a scalar, it will be expanded to have the size [m, m]. m should be a non-negative integer.sigma should contain non-negative numbers.normrnd(mu, sigma, s1, s2,..., sn)mu and sigma, respectivley.s1, s2, ... sn should be real, non-negative integers.s1, s2, ..., sn].mu and sigma should be either a scalar or should have the size [s1, s2, ..., sn].mu or sigma is a scalar, it will be expanded to match the size [s1, s2, ..., sn]. sigma should contain non-negative numbers.normrnd(mu, sigma, sizeVec)mu and sigma.sizeVec.mu and sigma should be a scalar or should have size sizeVec.mu or sigma is a scalar, it will be expanded to match the size sizeVec. sigma should contain non-negative numbers.normrnd with % 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))
ans =
1.0011
ans =
2.0023