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))

추가 답변 (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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by