FUNCTION REFERENCE
nbinrnd
Negative binomial random numbers.
Negative binomial random numbers.
Syntax
R = nbinrnd(R, P)Syntax
R = nbinrnd(R, P, m, n, ...)Syntax
R = nbinrnd(R, P, [m n ...])Draws from the negative binomial distribution with R > 0 successes (need not be an integer) and success probability P in [0, 1] (P = 0 puts all the mass at Inf); X counts the failures before the R-th success. 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); nbinrnd(3, 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.