Set global random number stream
designates the random number stream, specified as
prevstream = RandStream.setGlobalStream(
stream, to be the
global stream that the
randn functions draw values from. It returns
the previous global random number stream as
randn all rely on the same stream of uniform
pseudorandom numbers, known as the global stream.
rand draws one value from that stream to generate each uniform value it
randi draws one uniform value from that stream
to generate each integer value it returns. And
randn draws one or more uniform values to generate each normal value it
returns. Note that you can also specify a specific random stream from which
randn draw values by creating a
RandStream object and passing it as the first input argument.
rng function is a shorter alternative for
many common uses of
stream — Random number stream
Random number stream, specified as a
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Introduced in R2011a