Zscore a matrix with NaN
古いコメントを表示
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!
採用された回答
その他の回答 (1 件)
jkr
2017 年 6 月 21 日
5 投票
A simple approach for a vector 'x':
zscore = (x - nanmean(x))/nanstd(x);
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!