How to generate a random number that is greater than or equals to a given number

18 views (last 30 days)
example
a=5
y=randi(number)>=a

Answers (1)

KSSV
KSSV on 21 Mar 2018
N = 1000 ;
a = 5;
b = 100;
r = (b-a).*rand(N,1) + a;

Categories

Find more on Random Number Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!