How to generate a random number in matlab?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How to generate a random number in matlab?
0 commentaires
Réponse acceptée
Jan
le 8 Mar 2015
Modifié(e) : Jan
le 8 Mar 2015
This is shown in the documentation: doc rand , especially: floating-point-numbers-within-specific-range
a = 0.01;
b = 50;
r = (b-a) * rand + a;
Reading the documentation is a very efficient way to solve such questions. The docs of Matlab are excellent.
0 commentaires
Plus de réponses (1)
Konstantinos Sofos
le 10 Mar 2015
Hi,
myrandom = randi([0.01,50],1,1);
Mathworks documentation is excellent!
Regards
Voir également
Catégories
En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!