See https://github.com/tamaskis/rand2-MATLAB or “DOCUMENTATION.pdf” for additional documentation and examples. Examples can also be found in “EXAMPLES.m”.
The "rand2" function is an extension of the built-in "rand" and "randi" functions. While "rand" returns random floats between 0 and 1 and "randi([imin,imax])" returns random integers between imin and imax, the "rand2" function can return a random number (can be specified as either an integer, single-precision floating-point number, or double-precision floating-point number) between two numbers: a lower bound (a) and an upper bound (b).
Tamas Kis (2021). Random Number Generator in a Range (rand2) (https://github.com/tamaskis/rand2-MATLAB/releases/tag/v2.0.2), GitHub. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!