How can I generate a random real numbers from a specific range?
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdulatif Alabdulatif
am 13 Sep. 2014
Bearbeitet: Image Analyst
am 14 Sep. 2014
Hi all,
I want to pick real numbers randomly from a specific range (0 , 0.2304). Can any one help me to do that?
Thank you
1 Kommentar
Akzeptierte Antwort
Azzi Abdelmalek
am 13 Sep. 2014
Bearbeitet: Azzi Abdelmalek
am 13 Sep. 2014
rand*0.2304
For a general case (a,b)
a=0.12
b=0.45
out=a+(b-a)*rand;
2 Kommentare
Image Analyst
am 14 Sep. 2014
Bearbeitet: Image Analyst
am 14 Sep. 2014
out4decimalPlaces = round(out * 10000)/10000
Please mark Azzi's answer as Accepted now.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!