MATLAB Answers

How to generate a random integer between two bounds?

26 views (last 30 days)
Hello,
I want to generate a random integer between two integers
Suppose the upper bound UP=500 and the lower bound LB=4 how to generate a random integer between these 2 bounds
Thank you!

  0 Comments

Sign in to comment.

Accepted Answer

Alex Mcaulley
Alex Mcaulley on 4 Sep 2019
randi([4,500])

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.