How to use "nan"

조회 수: 8 (최근 30일)
gyeonggeun kim
gyeonggeun kim 2021년 3월 26일
댓글: gyeonggeun kim 2021년 3월 26일
I want to get rid of the color by using "nan" ,marked on the map.
The code is as follows.
  댓글 수: 2
John D'Errico
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
gyeonggeun kim 2021년 3월 26일
I want to change the pixels to blue and make them look as smooth as any other turbulent region in the area.

댓글을 달려면 로그인하십시오.

답변 (2개)

Veronica Taurino
Veronica Taurino 2021년 3월 26일
  댓글 수: 1
gyeonggeun kim
gyeonggeun kim 2021년 3월 26일
Thanks~

댓글을 달려면 로그인하십시오.


KSSV
KSSV 2021년 3월 26일
편집: KSSV 2021년 3월 26일
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
KSSV
KSSV 2021년 3월 26일
u(u>val) = 0 ; % any number else from 0 also can be taken
gyeonggeun kim
gyeonggeun kim 2021년 3월 26일
I will try it!! thank you

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by