Replace -99 with NaN

5 次查看(过去 30 天)
Megan Mirkhanian
Megan Mirkhanian 2020-1-20
评论: Stephen23 2022-2-27
How do I repalce -99 values with NaN?

回答(3 个)

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

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

VBBV
VBBV 2022-2-27
编辑:VBBV 2022-2-27
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 个评论
Stephen23
Stephen23 2022-2-27
Use READMATRIX instead of LOAD.
That fact that LOAD imports a limited set of text files is really for compatilbilty with ancient MATLAB versions.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by