Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

list (RandStream) - Random number generator algorithms

Class

@RandStream

Syntax

RandStream.list

Description

RandStream.list lists all the generator algorithms that may be used when creating a random number stream with RandStream or RandStream.create. The available generator algorithms and their properties are given in the following table.

KeywordGeneratorMultiple Stream and Substream SupportApproximate Period In Full Precision
mt19937arMersenne twister (used by default stream at MATLAB startup)No
mcg16807Multiplicative congruential generatorNo
mlfg6331_64Multiplicative lagged Fibonacci generatorYes
mrg32k3aCombined multiple recursive generatorYes
shr3congShift-register generator summed with linear congruential generatorNo
swb2712Modified subtract with borrow generatorNo

For a full description of the Mersenne twister algorithm, see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.

All of the generator and transformation algorithms that were available in MATLAB versions 7.6 and earlier are available in the current version. To create random streams that are equivalent to the legacy generators without entering into legacy mode, use the following syntaxes:

Legacy modeRandStream syntax
rand('seed',0)

(RandStream('mcg16807', 'Seed',0))

rand('state'0)

(RandStream('swb2712','Seed',0))

rand('twister',5489)

(RandStream('mt19937ar', 'Seed', 5489))

randn('seed',0)

(RandStream('mcg16807', 'Seed',0))

randn('state',0)

(RandStream('shr3cong'))

For more information on compatibility issues with MATLAB versions 7.6 and earlier, see Legacy Mode in the MATLAB Mathematics documentation.

  


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