Replace -99 with NaN

3 ビュー (過去 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 Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by