How to set all elements of a matrix that meet a certain criteria to NaN?

1 回表示 (過去 30 日間)
Leon
Leon 2018 年 3 月 14 日
コメント済み: Star Strider 2018 年 3 月 14 日
I have a Matrix A with the size of [200 100 20 60]. How do I set all elements larger than 10^20 as NaN?

採用された回答

Star Strider
Star Strider 2018 年 3 月 14 日
Try this:
A(A > 1E+20) = NaN;
  2 件のコメント
Leon
Leon 2018 年 3 月 14 日
It works perfectly. Thank you very much!
Star Strider
Star Strider 2018 年 3 月 14 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by