RandIntegers

Selects random integers between and inclusive of specified lower and upper limits.
1,5K descargas
Actualizado 17 ene 2006

Ver licencia

RANDINTEGERS(LOWER_BOUND,UPPER_BOUND) is a one line function that uses RAND to return a random integer between and inclusive of the two specified integers LOWER_BOUND and UPPER_BOUND (with uniform probability) (and with replacement).

The third argument M_SIZE is optional. If specified as a scalar, the output is a matrix with size [m_size m_size] and containing the values stated above. If specified as a row vector, the output is an array with size [m_size] and containing the same.

Examples:

randinteger(11,25) may return 23 or 25 or 11
randinteger(11,25,2) may return [25 12; 15 24]
randinteger(11,25,[1 3]) may return [14 23 17]

Remarks:

As depicted in the help text within the function, the Communications and Statistics toolboxes each contain a function that can be used for the same purpose.

[Please subscribe to this file if you use it, so you can be notified of updates.]

Citar como

Skynet (2024). RandIntegers (https://www.mathworks.com/matlabcentral/fileexchange/6207-randintegers), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R14SP3
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

Fixed minor error in Summary.