How to use "nan"
이전 댓글 표시
I want to get rid of the color by using "nan" ,marked on the map.

The code is as follows.

댓글 수: 2
John D'Errico
2021년 3월 26일
What does getting rid of a color mean here? Are you asking to replace those pixels with new ones that are blue, and look smoothly like the rest of the turbulent region in that area? Or do you just want to have a white area in that region, so essentially nothing plotted?
gyeonggeun kim
2021년 3월 26일
답변 (2개)
LEt's say you want to change the values beyond a given value val (a number) into NaN. Use:
u(u>val) = NaN ;
isnan is afunction used to check whether a value is nan or not. You can check after replacing values with NaN using:
u(isnan(u))
댓글 수: 11
gyeonggeun kim
2021년 3월 26일
KSSV
2021년 3월 26일
Why do you think it is not working? Show us your code, attach your data.
gyeonggeun kim
2021년 3월 26일
Veronica Taurino
2021년 3월 26일
편집: Veronica Taurino
2021년 3월 26일
So you don't want BOTH white and yellow?
What do you want instead of white? Your request is not clear...
gyeonggeun kim
2021년 3월 26일
Veronica Taurino
2021년 3월 26일
편집: Veronica Taurino
2021년 3월 26일
...this is just worse than before ahah now I just get those blue shapes are Japan and Korea. But I don't get how this is answering to my previous question... I'm sorry
gyeonggeun kim
2021년 3월 26일
KSSV
2021년 3월 26일
If you replace values with NaN obviously it will show up as NaN. Instead of NaN replace it with a value.
gyeonggeun kim
2021년 3월 26일
KSSV
2021년 3월 26일
u(u>val) = 0 ; % any number else from 0 also can be taken
gyeonggeun kim
2021년 3월 26일
카테고리
도움말 센터 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
