# Documentation of eof_dan2

Global Index (all files) (short | long)
| Local Index (files in subdir) (short | long)

## Function Synopsis

[lam, lds, per] = eof_dan(c, nkp);

## Help text

[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.

## Listing of function eof_dan2

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);