Contents Previous Next Subchapters

Generating Normally Distributed Pseudo Random Numbers
Syntax snormal(rows)
See Also randn , rand , seed , ranseed , cnormal , inormal

Returns a real matrix in which the elements simulate independent realizations of the normally distributed random variable with mean 0 and variance 1, where rows and cols are the number of rows and columns, respectively, in the result. If the argument cols is not present, a square matrix is returned.

The seed and ranseed functions can change the initial point of the simulated random sequence.

     noise = snormal(100, 1)
     gstyle("cross", 1, 20)
returns the following plot:

In Mlmode , this function is called randn instead of snormal. If in Mlmode you enter
     noise = randn(100, 1);
     x     = 1:100;
     plot(x, noise, 'x')
O-Matrix will draw the same plot as above except with a larger symbol style.

The arguments must be scalars. If they are logical, real, double-precision or complex, the corresponding integer values are used.