how to create an array of size (x by y ) of normally distributed numbers having a range [a , b]
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Sanwal Chaudhry
il 12 Apr 2020
Risposto: David Hill
il 12 Apr 2020
x = randi(20,5,7)
This randi func is used for uniformly distributed numbers. And for normally distributed numbers randn should be used.
But the randn func only takes the dimensions of the array which we want to create. I am a beginner. So I am stuck in the very basics.
Also I do not have mean and standard deviation values.
1 Commento
Risposta accettata
David Hill
il 12 Apr 2020
If you have the mean and standard deviation, then:
sd = 5;
mu = 500;
X = sd.*randn([x,y]) + mu;
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!