FUNCTION REFERENCE

binornd

Binomial random numbers.

Binomial random numbers.

Syntax

R = binornd(N, P)

Syntax

R = binornd(N, P, m, n, ...)

Syntax

R = binornd(N, P, [m n ...])

Draws from the binomial distribution with N trials (a nonnegative integer) and success probability P in [0, 1]. Without a size the result has the common size of the parameters; with one, non-scalar parameters must have that size. Invalid parameters give NaN.

Example

rng(0); binornd(10, 0.4, 1, 3)

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.