obtaining values major than 10e-7
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I use rand function to generate values
x = rand;
after that I compared generated values to
10e-7
if x > 10e-7
do something
end
unfortunately rand generates values always bigger 10e-7. How can I generate values that are less than 10e-7 using rand function?
1 commentaire
Réponses (1)
Azzi Abdelmalek
le 15 Sep 2012
x = rand*10e-7
3 commentaires
Azzi Abdelmalek
le 15 Sep 2012
Modifié(e) : Azzi Abdelmalek
le 15 Sep 2012
x = 2*rand*10e-7
%you will have randomly > or <
Voir également
Catégories
En savoir plus sur Logical 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!