function [E,V,A,C]=eeof(X, M, convert)
% Syntax: [E,V,A,C]=eeof(X, M); [E,V,A,C]=eeof(X, M, 1);
% This function performs an extended empirical orthogonal
% function (EEOF) analysis of matrix 'X', for embedding dimension 'M'.
% Each of the L columns of X is a time series of length N.
%
% Returns: E - eigenfunction matrix. (LM by LM)
% V - vector containing variances (unnormalized eigenvalues).
% A - matrix of principal components.
% C - lag-covariance matrix.
1