corr returns NaN
古いコメントを表示
I'm calculating the correlation coefficient between two vectors, using corr. It returns NaN, and I'm curious to know why that is the case.
c and d are the vectors.
>> [c d]
ans =
1 1
2 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
採用された回答
その他の回答 (1 件)
Bio_Ing_Sapienza
2019 年 2 月 24 日
1 投票
Maybe you have to ceck for "Inf" components in your array. Sometimes I was searching from Nan even if I had already checked them out. But there are other kind of Matlab numeric representation for results came from division that yields to too large numbers to be represented with floating number. So check also for these ones!
カテゴリ
ヘルプ センター および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!