Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

setDefaultStream (RandStream) - Set default random number stream

Syntax

prevstream = RandStream.setDefaultStream(stream)

Description

prevstream = RandStream.setDefaultStream(stream) returns the current default random number stream, and designates the random number stream stream as the new default to be used by the rand, randi, and randn functions.

rand, randi, and randn all rely on the same stream of uniform pseudorandom numbers, known as the default stream. randi uses one uniform value from the default stream to generate each integer value. randn uses one or more uniform values from the default stream to generate each normal value. Note that there are also rand, randi, and randn methods for which you specify a specific random stream from which to draw values.

See Also

getDefaultStream (RandStream), @RandStream, rand (RandStream), randn (RandStream), randperm (RandStream)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS