Highly useful for any meteorological, geophysical etc. series of observations in which missing data are expected
Isabella Osetinsky-Tzidaki (2021). nancorr (https://www.mathworks.com/matlabcentral/fileexchange/35501-nancorr), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Here is a vectorized nancorr - it works same as buitlin corr(A, B, 'Rows', 'pairwise'), but faster.
https://se.mathworks.com/matlabcentral/fileexchange/71893-nancorr
merci beaucoup
Thank Matthew, first, you are welcomed to create a matrix version for this code. My code was aimed for the series (as written in a short explanation). Second, I did not regard any efficiency matter for it was urgently to do something quick and simple to calculate cor.coef. between the series with missing data. You are welcomed to improve it, up to you! Thank you in advance
Contains an inefficient for loop (should be replaced with logical indexing) and does not replicate the behavior of MATLAB's corr when A, B are matrices.