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
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Miguel Reina
il 28 Set 2016
Modificato: Massimo Zanetti
il 28 Set 2016
thank you in advance
0 Commenti
Risposta accettata
Massimo Zanetti
il 28 Set 2016
Modificato: Massimo Zanetti
il 28 Set 2016
Here it is.
rnd = 0.1*(randi(11)-1);
It gives a random number among 0.0, 0.1, ... , 1.0
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!