Statistics Toolbox | ![]() ![]() |
Random numbers from the normal distribution
Syntax
Description
R = normrnd(MU,SIGMA)
generates normal random numbers with mean MU and standard deviation SIGMA. Vector or matrix inputs for MU and SIGMA must have the same size, which is also the size of R
. A scalar input for MU or SIGMA is expanded to a constant matrix with the same dimensions as the other input.
R = normrnd(MU,SIGMA,m)
generates normal random numbers with parameters MU and SIGMA, where m is a 1-by-2 vector that contains the row and column dimensions of R.
R = normrnd(MU,SIGMA,m,n)
generates normal random numbers with parameters MU and SIGMA, where scalars m and n are the row and column dimensions of R.
Examples
n1 = normrnd(1:6,1./(1:6)) n1 = 2.1650 2.3134 3.0250 4.0879 4.8607 6.2827 n2 = normrnd(0,1,[1 5]) n2 = 0.0591 1.7971 0.2641 0.8717 -1.4462 n3 = normrnd([1 2 3;4 5 6],0.1,2,3) n3 = 0.9299 1.9361 2.9640 4.1246 5.0577 5.9864
See Also
normfit
, normfit
, norminv
, normpdf
, normplot
, normspec
, normstat
![]() | normplot | normspec | ![]() |