Zscore a matrix with NaN
Afficher commentaires plus anciens
I have matrix A, and I need to find a zscore value (with the intention of running a PCA) of a matrix that has NaN values. I need to have matlab ignore the NaNs while solving for the zscore value. How can I do this? I tried Zscore = zscore(~isnan(A)) but it didn't work.
Thanks for your help!
Réponse acceptée
Plus de réponses (1)
jkr
le 21 Juin 2017
5 votes
A simple approach for a vector 'x':
zscore = (x - nanmean(x))/nanstd(x);
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!