Replace numbers without using find()

2 ビュー (過去 30 日間)
timetry2
timetry2 2019 年 10 月 11 日
編集済み: Adam Danz 2019 年 10 月 11 日
I have a code that looks like this: A = randi([100,200],1000,1000)
Is there a code I can use that will replace all numbers between 150 and 200 with Nan without using the find ()?

採用された回答

Adam Danz
Adam Danz 2019 年 10 月 11 日
編集済み: Adam Danz 2019 年 10 月 11 日
A(A>150 & A<200) = NaN;
I interpret "between" as not inclusive. If you want inclusive,
A(A>=150 & A<=200) = NaN;

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by