function [r p] = nancorrcoef_MMO(x,y)
%NANCORRCOEF - Compute correlation for input vectors that contain NaN values 
%
%Syntax:  [r p] = nancorrcoef(x,y);
%
%Inputs: X -  First input vector
%        Y - Second input vector
%
%Output: R - Correlation coefficient, P - Significance


%%%% remove entries in x & y with NaNs in x

ix = isfinite(x);
indix = find(ix == 0);
x(indix) = [];
y(indix) = [];

iy = isfinite(y);
indiy = find(iy == 0);
x(indiy) = [];
y(indiy) = [];

[r p] = corrcoef(x,y);


