How to select a random number from set 5:20:2000?

1 view (last 30 days)
How to select a random number from set 5:20:2000?

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 8 Jun 2019
Edited: KALYAN ACHARJYA on 8 Jun 2019
idx=5:20:2000;
rand_num=idx(randi(length(idx)));

More Answers (0)

Categories

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

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!