| Statistics Toolbox | Search  Help Desk |
| normrnd | Examples |
Random numbers from the normal distribution.
Syntax
R = normrnd(MU,SIGMA) R = normrnd(MU,SIGMA,m) R = normrnd(MU,SIGMA,m,n)
Description
R = normrnd(MU,SIGMA) generates normal random numbers with mean, MU, and standard deviation, SIGMA . The size of R is the common size of MU and SIGMA if both are matrices. If either parameter is a scalar, the size of R is the size of the other parameter. R = normrnd(MU,SIGMA,m) generates normal random numbers with parameters MU and SIGMA. 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. The 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