How can I generate a sequence of normally distrubuted random variables with a specified mean and variance?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I want to generate a sequence with 10000 points of random variables with a gaussian distribution with mean 𝜇=1.5and variance 𝜎2=2.25. I'm not sure where to start or how to approach this problem.
0 Commenti
Risposta accettata
Ameer Hamza
il 1 Dic 2020
You can use normrnd(): https://www.mathworks.com/help/stats/normrnd.html if you have Statistics and Machine Learning Toolbox.
mu = 1.5;
Var = 2.25;
x = normrnd(mu, sqrt(Var), [1 10000])
Otherwise you can also use randn()
mu = 1.5;
Var = 2.25;
x = randn(1, 10000)*sqrt(Var)+mu;
2 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!