how to random value?
1 view (last 30 days)
Show older comments
how to random value 2 until 3? example:
but i want the answer 2,3 or 2,5 or 2,6, or 3. thanks
Edited: Azzi Abdelmalek on 3 Apr 2013
Mahdi on 3 Apr 2013
Edited: Mahdi on 3 Apr 2013
Generate values from the uniform distribution on the interval [a, b].
r = 2 + (3-2).*rand(1);
or the general form
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!