How can I select a random number between 0 and 1, if the result should have only one decimal ? e.g result= 0.6 , result=0.2, result =0.9
1 次查看(过去 30 天)
显示 更早的评论
thank you in advance
0 个评论
采纳的回答
Massimo Zanetti
2016-9-28
编辑:Massimo Zanetti
2016-9-28
Here it is.
rnd = 0.1*(randi(11)-1);
It gives a random number among 0.0, 0.1, ... , 1.0
0 个评论
更多回答(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!