站点图标

Matlab Tutorial 04 official PCA


  本文介绍如何在Matlab中使用官方库函数提供的PCA方法。

.1 pca()参数介绍

coeff = pca(X)
coeff = pca(X,Name,Value)
[coeff,score,latent] = pca(___)
[coeff,score,latent,tsquared] = pca(___)
[coeff,score,latent,tsquared,explained,mu] = pca(___)

  下面介绍它的输入参数:

.2 实例

[cfPC, cfScore, cfLatent, cfLsquare] = pca(ClassFeature);
cfAcc = cumsum(cfLatent) ./ sum(cfLatent);
% 变换矩阵
cfTran = cfPC(:, 1:4);
ClassFeature = bsxfun(@minus, ClassFeature, mean(ClassFeature, 1));
ClassFeaturePCA = ClassFeature * cfTran; 
退出移动版