FUNCTION REFERENCE
unifrnd
Continuous uniform random numbers.
Continuous uniform random numbers.
Syntax
R = unifrnd(A, B)Syntax
R = unifrnd(A, B, m, n, ...)Syntax
R = unifrnd(A, B, [m n ...])Draws from the continuous uniform distribution with support [A, B] with A < B (defaults 0 and 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); unifrnd(0, 2, 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 (normrnd and unifrnd use the same numbers as randn and rand).
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.