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일

1 개 추천

A(A>150 & A<200) = NaN;
I interpret "between" as not inclusive. If you want inclusive,
A(A>=150 & A<=200) = NaN;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 NaNs에 대해 자세히 알아보기

질문:

2019년 10월 11일

편집:

2019년 10월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by