Replacing a value with nan
古いコメントを表示
Hello all. I want to replace a value that I have in accuracyC with nan if its counterpart value is nan in RTc. RTc and accuracyC are two matrices. I have written this loop but it does not work. I appreciate your help.
h=0;
for i=1:size(accuracyC,1)
for j=1:size(accuracyC,2)
if RTc(i,j)==nan
accuracyC(i,j)=NaN;
h=h+1;
end
end
end
採用された回答
その他の回答 (1 件)
Dennis
2018 年 4 月 18 日
0 投票
I read about this lately, NaN never equals NaN (some IEEE stuff).
But you can use isnan instead.
カテゴリ
ヘルプ センター および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!