replace all the array with NaN if any of the value is NaN
2 ビュー (過去 30 日間)
古いコメントを表示
i am working with some data and the condition i want to set is that, if in the data there is NaN value in any column i want to replace that whole column with NaN values. following is a screen shot of my data structure. where i am working on the third dimension (144) of the data. Thanks in advance for help
0 件のコメント
採用された回答
その他の回答 (1 件)
Jan
2017 年 9 月 27 日
Without a loop and bsxfun:
A = randi(9, 4, 3, 2);
A(6) = NaN;
A(:, any(isnan(A), 1)) = NaN;
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!