randn (RandStream) - Normally distributed pseudorandom numbers
Class
@RandStream
Syntax
randn(s,m,n)
randn(s,[m,n])
randn(s,m,n,p,...)
randn(s,[m,n,p,...])
randn(s)
randn(s,size(A))
r = randn(..., 'double')
r
= randn(..., 'single')
Description
r = randn(s,n) returns an n-by-n matrix
containing pseudorandom values drawn from the standard normal distribution. randn draws
those values from the random stream s. randn(s,m,n) or randn(s,[m,n]) returns
an m-by-n matrix. randn(s,m,n,p,...) or randn(s,[m,n,p,...]) returns
an m-by-n-by-p-by-...
array. randn(s) returns a scalar. randn(s,size(A)) returns
an array the same size as A.
r = randn(..., 'double') or r
= randn(..., 'single') returns an array of uniform values
of the specified class.
Note
The size inputs m, n, p,
... should be nonnegative integers. Negative integers are treated
as 0. |
The sequence of numbers produced by randn is determined
by the internal state of the random stream s. randn uses one
or more uniform values from s to generate each
normal value. Resetting that stream to the same fixed state allows
computations to be repeated. Setting the stream to different states
leads to unique computations, however, it does not improve any statistical
properties.
See Also
randn, @RandStream, rand (RandStream), randi (RandStream)
 | randn | | randperm |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit