⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visualizationguassdata.m

📁 本贝叶斯分类器可以实现对二维高斯分布样本的分类
💻 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 + -