random
Random numbers
Syntax
Description
generates an array of random numbers from the specified probability distribution
using input arguments from any of the previous syntaxes, where
R
= random(___,sz1,...,szN
)sz1,...,szN
indicates the size of each
dimension.
Examples
Input Arguments
Output Arguments
Alternative Functionality
random
is a generic function that accepts either a distribution by its namename
or a probability distribution objectpd
. It is faster to use a distribution-specific function, such asrandn
andnormrnd
for the normal distribution andbinornd
for the binomial distribution. For a list of distribution-specific functions, see Supported Distributions.To generate random numbers interactively, use
randtool
, a user interface for random number generation.