MATLAB Answers

eliminating NaN values from an array

조회 수: 7(최근 30일)
KalMandy
KalMandy 10 Nov 2016
답변: Steven Lord 19 Jan 2020
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 ]

  댓글 수: 0

로그인 to comment.

채택된 답변

Guillaume
Guillaume 10 Nov 2016
newarray = originalarray(~isnan(originalarray))

  댓글 수: 1

KalMandy
KalMandy 10 Nov 2016
Thank you so much!

로그인 to comment.

추가 답변(2개)

Sara Sahraoui
Sara Sahraoui 18 Jan 2020
Comment eliminer les nans sur data

  댓글 수: 0

로그인 to comment.


Steven Lord
Steven Lord 19 Jan 2020
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.

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by