RandIntegers

버전 1.0.0.0 (2 KB) 작성자: Skynet
Selects random integers between and inclusive of specified lower and upper limits.
다운로드 수: 1.5K
업데이트 날짜: 2006/1/17

라이선스 보기

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.]

인용 양식

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

MATLAB 릴리스 호환 정보
개발 환경: R14SP3
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Fixed minor error in Summary.