While all elements are not equal to NaN
66 ビュー (過去 30 日間)
古いコメントを表示
I have an array and I turn one element to NaN in each iteration until all elements are NaN, like:
While (all elements in array are not NaN)
do aomething
End
How can I do this?
0 件のコメント
採用された回答
Jos (10584)
2018 年 3 月 1 日
not (~), all, and isnan are your friends. If A is your array,
while ~all(isnan(A(:)))
...
end
2 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!