Generate bounded random numbers
Version 1.0.2 (1.66 KB) by
mattpatten.au
Generates uniformly distributed random numbers between two bounds.
A very simple function that generates a set of uniformly-distributed random numbers restricted to be within a specified range. The code is trivial, but nonetheless useful to maximise whitespace in your own code if you need to perform this action regularly.
Cite As
mattpatten.au (2026). Generate bounded random numbers (https://www.mathworks.com/matlabcentral/fileexchange/71660-generate-bounded-random-numbers), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2019a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Random Number Generation in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
