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 comentarios

John D'Errico
John D'Errico el 26 de Mzo. de 2021
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 el 26 de Mzo. de 2021
I want to change the pixels to blue and make them look as smooth as any other turbulent region in the area.

Iniciar sesión para comentar.

Respuestas (2)

KSSV
KSSV el 26 de Mzo. de 2021
Editada: KSSV el 26 de Mzo. de 2021

0 votos

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 comentarios

gyeonggeun kim
gyeonggeun kim el 26 de Mzo. de 2021
Thanks but it doesn't working.....
KSSV
KSSV el 26 de Mzo. de 2021
Why do you think it is not working? Show us your code, attach your data.
gyeonggeun kim
gyeonggeun kim el 26 de Mzo. de 2021
u(u>=1) = NaN;
u(isnan(u))
I don't want white , I hope the yellow part doesn't show up.
Veronica Taurino
Veronica Taurino el 26 de Mzo. de 2021
Editada: Veronica Taurino el 26 de Mzo. de 2021
So you don't want BOTH white and yellow?
What do you want instead of white? Your request is not clear...
gyeonggeun kim
gyeonggeun kim el 26 de Mzo. de 2021
I'm sorry... um...
I don't want to be expressed under Japan!!
So I wish the Korean Strait would stand out better.
Veronica Taurino
Veronica Taurino el 26 de Mzo. de 2021
Editada: Veronica Taurino el 26 de Mzo. de 2021
...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
gyeonggeun kim el 26 de Mzo. de 2021
Thank you for trying to answer.
KSSV
KSSV el 26 de Mzo. de 2021
If you replace values with NaN obviously it will show up as NaN. Instead of NaN replace it with a value.
gyeonggeun kim
gyeonggeun kim el 26 de Mzo. de 2021
u(u>nan) = 0 ;
like this?
KSSV
KSSV el 26 de Mzo. de 2021
u(u>val) = 0 ; % any number else from 0 also can be taken
gyeonggeun kim
gyeonggeun kim el 26 de Mzo. de 2021
I will try it!! thank you

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Mzo. de 2021

Comentada:

el 26 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by