


COR calculates the correlation matrix
X and Y can contain missing values encoded with NaN.
NaN's are skipped, NaN do not result in a NaN output.
(Its assumed that the occurence of NaN's is uncorrelated)
The output gives NaN only if there are insufficient input data
COR(X);
calculates the (auto-)correlation matrix of X
COR(X,Y);
calculates the crosscorrelation between X and Y
c = COR(...);
c is the correlation matrix
W weights to compute weighted mean (default: [])
if W=[], all weights are 1.
number of elements in W must match size(x,DIM)