# MATLAB_RANDOM Matlab's Random Number Generators

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

### Languages:

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

### Related Data and Programs:

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.

### Source Code:

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

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().

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.

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

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.

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

Last revised on 13 February 2013.