FUNCTION REFERENCE
random
Random numbers from a named distribution.
Random numbers from a named distribution.
Syntax
R = random(name, A, B, ...)Syntax
R = random(name, A, B, ..., m, n, ...)Syntax
R = random(name, A, B, ..., [m n ...])Same as the family function, e.g. random('Normal', MU, SIGMA, 2, 3) is normrnd(MU, SIGMA, 2, 3): the first arguments after the name are the parameters, the rest the size. Names as in pdf.
Example
rng(1); random('Exponential', 2, 1, 4)Distribution objects also support random(pd,m,n) or random(pd,[m n]).
Differences from MATLAB: draws use the session's Mersenne Twister stream, so rng(seed) makes them reproducible; for a given seed the numbers follow the same distribution as MATLAB's but are not the same numbers.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.