?? exa011003_randn.m
字號:
%-----------------------------------------------------------------
% exa011003_randn, for example 1.10.3
% to test randn.m and to generate the white noise signal u(n)
% with Gaussian distribution and power p
% 產生高斯分布的白噪信號,使功率為p,并觀察數據分布的直方圖
%-----------------------------------------------------------------
clear;
p=0.1;
N=500000;
u=randn(1,N);
a=sqrt(p)
u=u*a;
power_u=var(u)
subplot(211)
plot(u(1:200));grid on;
ylabel('u(n)');
xlabel('n')
subplot(212)
hist(u,50);grid on;
ylabel('histogram of u(n)');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -