| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
RandStream.list
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.
| Keyword | Generator | Multiple Stream and Substream Support | Approximate Period In Full Precision |
|---|---|---|---|
| mt19937ar | Mersenne twister (used by default stream at MATLAB startup) | No |
|
| mcg16807 | Multiplicative congruential generator | No |
|
| mlfg6331_64 | Multiplicative lagged Fibonacci generator | Yes |
|
| mrg32k3a | Combined multiple recursive generator | Yes |
|
| shr3cong | Shift-register generator summed with linear congruential generator | No |
|
| swb2712 | Modified subtract with borrow generator | No |
|
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 mode | RandStream 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.
![]() | linspace | listdlg | ![]() |

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 |