📄 da_pca.m
字号:
%
% da_pca
%
% Entry point into PCA routines
%
%
% Clear whole screen
%
clg;
drawnow;
set(w1,'NumberTitle','off','Name','Principal Component Variances');
%
% Say it's calculating data
%
text1=uicontrol(w1,...
'Style','text',...
'Position',[230 300 150 15],...
'String','Working. Please wait....',...
'BackGroundColor',[0 0 0],...
'ForeGroundColor',[1 1 1]);
%
% Prepare the process data by including the desired variables
% and excluding the output variable
%
pc_data=pcincl(data,include_var,output_var);
%
% Now work through the data to make sure that there are no
% variables that remain constant. If there are, remove them.
%
[D L]=size(pc_data);
s=std(pc_data);
count=1;
for i = 1 : L
if s(i)~=0
temp(:,count)=pc_data(:,i);
count=count+1;
else
include_var(i)=0;
output_var(i)=0;
end
end
pc_data=temp;
clear temp
[pc_data m s]=mcen(pc_data);
%[D L]=size(pc_data);
%[pcs c ssq res q tst]=pca(pc_data,0,0,L);
%
% Own PCA routine
%
[pcs c ssq]=pcomp(pc_data);
clear pc_data m
[dummy num_pcs]=size(pcs);
%
% Draw the axes
%
da_pcavr;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -