📄 visualizationguassdata.m
字号:
% To create a 1D Gaussian Distribution and show its histogram
model = struct('Mean',1,'Cov',2); % Gaussian parameters
figure(1); hold on;
% plot pdf of the Gaussisan Distribution
X_theo=[-4:0.2:5];
Y_theo=pdfgauss(X_theo,model);
Y_theo=Y_theo/sum(Y_theo);
plot(X_theo,Y_theo,'r');
[Y,X] = hist(gsamp(model,500),50); % compute histogram
bar(X,Y/500); % plot histogram
% To create a 2D Gaussian Distribution and show its histogram
model.Mean = [1;1]; % Mean vector
model.Cov = [1 0; 0 1]; % Covariance matrix
figure(2); hold on;
data=gsamp(model,250);
ppatterns(data); % plot sampled data
pgauss(model); % plot shape
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -