필터 지우기
필터 지우기

How do I generate a random signal that follows normal distribution of mean value 0 and standard deviation 10 ?

조회 수: 2 (최근 30일)
Thanks to anyone for helping.

답변 (2개)

Walter Roberson
Walter Roberson 2023년 10월 30일
N = 1e7;
target_std = 10;
target_mean = 0;
data = randn(1,N) * target_std + target_mean;
%crosscheck
mean(data)
ans = -0.0013
std(data)
ans = 10.0025
You should not expect the experimental mean to exactly equal the target, or the experimental std to exactly equal the target.

Voss
Voss 2023년 10월 30일
% 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)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by