Random Number Generation

Seeds, distributions, algorithms

Start Here

Use the rand, randn, and randi functions to create sequences pseudorandom numbers. Use the rng function to control the repeatability of your results. Use the RandStream class when you need more advanced control over random number generation.

Functions

rand Uniformly distributed pseudorandom numbers
randn Normally distributed pseudorandom numbers
randi Uniformly distributed pseudorandom integers
randperm Random permutation
rng Control random number generation

Classes

RandStream Random number stream
Was this topic helpful?