%% 读取数据
A=xlsread('Coporation_evaluation.xlsx', 'B2:I16');
% Transfer orginal data to standard data
a=size(A,1); % Get the row number of A
b=size(A,2); % Get the column number of A
for i=1:b
SA(:,i)=(A(:,i)-mean(A(:,i)))/std(A(:,i)); % Matrix normalization
end
% Calculate correlation matrix of A.
CM=corrcoef(SA);
% Calculate eigenvectors and eigenvalues of correlation matrix.
[V, D]=eig(CM);
% Get the eigenvalue sequence according to descending and the corrosponding
MATLAB--PCA数据降维实例
最新推荐文章于 2023-10-30 11:32:22 发布