How to generate a random decimal number between 1.0 and 1.52?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Wen Shu Wong
il 29 Ott 2020
Commentato: Ameer Hamza
il 29 Ott 2020
rand([1.0,1]);
May I know why this is not working?
0 Commenti
Risposta accettata
Ameer Hamza
il 29 Ott 2020
Modificato: Ameer Hamza
il 29 Ott 2020
You can generate them by scaling and translating the output of rand()
range = [1.0,1.52];
x = rand()*diff(range)+range(1)
2 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!