example1_2.m
来自「一本关于dsp的原著教材」· M 代码 · 共 17 行
M
17 行
N1=10000;
mu=[730 1090];
sigma_3=[8000 0; 0 8000];
X3 = randn(N1,2)*sqrtm(sigma_3)+repmat(mu, N1, 1);
X=X3(1:1000,:);
N=size(X,1)
mu_1000=sum(X)/N
%mu_1000=mean(X)
sigma_1000=(X-repmat(mu_1000,N,1))'*(X-repmat(mu_1000,N,1))/(N-1)
%sigma_1000=cov(X)
% Comparison of the values:
e_mu=sqrt((mu_1000-mu)*(mu_1000-mu)')
% (This is the Euclidean distance between Mu_1000 and mu)
e_sigma=norm(sigma_1000-sigma_3)
% (This is the 2-norm of the difference between sigma_1000 and sigma_3)
%gausview(X3,mu,sigma_3, 'Sample X3');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?