Matlab's Random Number Generators

**MATLAB_RANDOM**
is a directory of MATLAB programs which
illustrate the use of Matlab's random number generators.

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

**MATLAB_RANDOM** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version.

ASA183, a MATLAB library which implements a pseudorandom number generator, by Wichman and Hill. This is a MATLAB version of Applied Statistics Algorithm 183.

MATLAB_RANDOM_PARALLEL, MATLAB programs which illustrate the use of Matlab's random number generator (RNG) functions when using parallel features such as parfor or spmd.

NORMAL, a MATLAB library which computes elements of a sequence of pseudorandom normally distributed values.

RANDLC, a MATLAB library which generates a sequence of pseudorandom numbers, used by the NAS Benchmark programs.

RANDOM_SORTED, a MATLAB library which generates vectors of random values which are already sorted.

RANLIB, a MATLAB library which produces random samples from Probability Density Functions (PDF's), including Beta, Chi-square Exponential, F, Gamma, Multivariate normal, Noncentral chi-square, Noncentral F, Univariate normal, random permutations, Real uniform, Binomial, Negative Binomial, Multinomial, Poisson and Integer uniform, by Barry Brown and James Lovato.

RNGLIB, a MATLAB library which implements a random number generator (RNG) with splitting facilities, allowing multiple independent streams to be computed, by L'Ecuyer and Cote.

UNIFORM, a MATLAB library which computes elements of a uniform pseudorandom sequence.

**RAND_TEST** is a simple example which demonstrates the use
of the rand() function to generate uniform random numbers, and to
set the seed.

- rand_test.m, the program.
- rand_test_output.txt, the output file.

**RANDI_TEST** is a simple example which demonstrates the use
of the randi() function to generate random integers, and to
set the seed. The Mathworks suggests using randi() instead of randint().

- randi_test.m, the program.
- randi_test_output.txt, the output file.

**RANDINT_TEST** is a simple example which demonstrates the use
of the randint() function to generate random integers, and to
set the seed. The randint() function is scheduled to be removed
from MATLAB soon.

- randint_test.m, the program.
- randint_test_output.txt, the output file.

**RANDN_TEST** is a simple example which demonstrates the use
of the randn() function to generate normal random numbers, and to
set the seed.

- randn_test.m, the program.
- randn_test_output.txt, the output file.

**RNG_TEST** demonstrates how the new RNG() function is used to
initialize and manipulate the state of the RAND, RANDINT, and RANDN random number
generators.

- rng_test.m, the program.
- rng_test_output.txt, the output file.

You can go up one level to the MATLAB source codes.