How do I generate a random signal that follows normal distribution of mean value 0 and standard deviation 10 ?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Thanks to anyone for helping.
0 Commenti
Risposte (2)
Walter Roberson
il 30 Ott 2023
N = 1e7;
target_std = 10;
target_mean = 0;
data = randn(1,N) * target_std + target_mean;
%crosscheck
mean(data)
std(data)
You should not expect the experimental mean to exactly equal the target, or the experimental std to exactly equal the target.
Voss
il 30 Ott 2023
% desired mean and standard deviation:
my_mean = 0;
my_std = 10;
% number of points:
n = 1000;
% generate the signal, using randn:
y = my_std*randn(1,n) + my_mean;
% plot:
plot(y)
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!