FUNCTION REFERENCE

geornd

Geometric random numbers.

Geometric random numbers.

Syntax

R = geornd(P)

Syntax

R = geornd(P, m, n, ...)

Syntax

R = geornd(P, [m n ...])

Draws from the geometric distribution with success probability P in [0, 1] (P = 0 puts all the mass at Inf); X counts the failures before the first 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); geornd(0.3, 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.