Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
[lam, lds, per] = eof_dan(c, nkp);
[lam, lds, per] = eof_dan(c, isrot, nkp); This function assumes that c is the covariance matrix. isrot is 1 if the column dimension is space (rather than time) nkp is the number of modes to spit out.
function [lam, lds, per] = eof_dan(c, nkp); if nargin < 2; nkp = 10; end; [lds, lam] = eig(c); l = diag(lam); [lam, k] = sort(l'); lds = lds(:,k); lam = fliplr(lam); lds = fliplr(lds); lds = lds(:,1:nkp); per = lam * 100 / sum(lam);