📄 pcac.m
字号:
% Read the NCEP predictor data to form a big matrix as the input of the PCA
function PCAC
% open the Necp data file
%if n==6
fid1=fopen('1.txt','r');
fid2=fopen('2.txt','r');
fid3=fopen('3.txt','r');
fid4=fopen('4.txt','r');
fid5=fopen('5.txt','r');
fid6=fopen('6.txt','r');
%end
%read the data to a new matrix
[A,COUNT]=fread(fid1,[14610,25],'float');
[B,COUNT]=fread(fid2,[14610,25],'float');
[C,COUNT]=fread(fid3,[14610,25],'float');
[D,COUNT]=fread(fid4,[14610,25],'float');
[E,COUNT]=fread(fid5,[14610,25],'float');
[F,COUNT]=fread(fid6,[14610,25],'float');
%[A,COUNT]=fread(fid1,[7360,25]);
%[B,COUNT]=fread(fid2,[7360,25],'float');
%[C,COUNT]=fread(fid3,[7360,25],'float');
%[D,COUNT]=fread(fid4,[7360,25],'float');
%[E,COUNT]=fread(fid5,[7360,25],'float');
%[F,COUNT]=fread(fid6,[7360,25],'float');
% Form a new matrix
DD=[A B C D E F];
%ST = fclose('all');
%[evals,evecs,efuns,edata]=pca(DD,0,1,0,'SEL',1);
[Z,R,LL]=PCA2(DD);
%disp(evals(:));
%disp(evecs(:));
save z.txt Z -ASCII -TABS;
save r.txt R -ASCII -TABS;
save ll.txt LL -ASCII -TABS;
%save evals.txt evals -ASCII -TABS;
%save evecs.txt evecs -ASCII -TABS;
%save efuns.txt efuns -ASCII -TABS;
ST = fclose('all');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -