How to generate a random decimal number between 1.0 and 1.52?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Wen Shu Wong
le 29 Oct 2020
Commenté : Ameer Hamza
le 29 Oct 2020
rand([1.0,1]);
May I know why this is not working?
0 commentaires
Réponse acceptée
Ameer Hamza
le 29 Oct 2020
Modifié(e) : Ameer Hamza
le 29 Oct 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Random Number Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!