standardizeMissing not converting selected values to NaN
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm having trouble getting standardizeMissing to perform its function. I have a 3x4209 array of int32 values called bl_height. Some of the values are -999. I'm trying to change the -999 values to NaN using standardizeMissing, but the -999 values are retained. Can someone tell me what I'm doing wrong? I've tried pretty much every iteration of standardizeMissing possible. Here's my code below:
bl_height=ncread(filename,'bl_height');
bl_height_edited = standardizeMissing(bl_height,-999);
댓글 수: 0
채택된 답변
Taylor
2024년 4월 4일
It's because your values are integers not doubles. There is no room for a NaN value when using integers. The documentation for the input data to standardizeMissing specifies that the input should be one of the following data types: double | single | char | string | cell | table | timetable | categorical | datetime | duration
댓글 수: 2
Taylor
2024년 4월 4일
Great! Just be aware that if you try to convert back to integers the NaN values will become 0s.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!