How can I generate a random real numbers from a specific range?
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Azzi Abdelmalek
2014-9-13
编辑:Azzi Abdelmalek
2014-9-13
rand*0.2304
For a general case (a,b)
a=0.12
b=0.45
out=a+(b-a)*rand;
2 个评论
Image Analyst
2014-9-14
编辑:Image Analyst
2014-9-14
out4decimalPlaces = round(out * 10000)/10000
Please mark Azzi's answer as Accepted now.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!