Replace -99 with NaN

5 visualizaciones (últimos 30 días)
Megan Mirkhanian
Megan Mirkhanian el 20 de En. de 2020
Comentada: Stephen23 el 27 de Feb. de 2022
How do I repalce -99 values with NaN?

Respuestas (3)

Stijn Haenen
Stijn Haenen el 20 de En. de 2020
x=[1 2 -99 3 4 -99 5 6 -99];
x(x==-99)=NaN;

Steven Lord
Steven Lord el 21 de En. de 2020
Consider using the standardizeMissing function. The first example on that documentation page does exactly what you described.

VBBV
VBBV el 27 de Feb. de 2022
Editada: VBBV el 27 de Feb. de 2022
Data = load('precip.txt'); % use load function
Data(Data == -99) = NaN
Use load function instead of readtable and try with commented line, in your snapshot code
  1 comentario
Stephen23
Stephen23 el 27 de Feb. de 2022
Use READMATRIX instead of LOAD.
That fact that LOAD imports a limited set of text files is really for compatilbilty with ancient MATLAB versions.

Iniciar sesión para comentar.

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by