フィルターのクリア

eliminating NaN values from an array

1 回表示 (過去 30 日間)
KalMandy
KalMandy 2016 年 11 月 10 日
回答済み: Steven Lord 2020 年 1 月 19 日
Hi, does someone know how to eleiminate NaN values from an array? For example I have an array [NaN 0.6451 NaN 0.8339 0.8015 ], I want to make it [0.6451 0.8339 0.8015 ]

採用された回答

Guillaume
Guillaume 2016 年 11 月 10 日
newarray = originalarray(~isnan(originalarray))
  1 件のコメント
KalMandy
KalMandy 2016 年 11 月 10 日
Thank you so much!

サインインしてコメントする。

その他の回答 (2 件)

Sara Sahraoui
Sara Sahraoui 2020 年 1 月 18 日
Comment eliminer les nans sur data

Steven Lord
Steven Lord 2020 年 1 月 19 日
In newer releases you can use rmmissing to remove missing data (NaN for double and single precision data, <undefined> for categorical arrays, etc.) There are other functions for working with missing data like fillmissing listed on this documentation page.

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by