How to make NaN data an empty entry
이전 댓글 표시
I have a 2160 by 4320 data that has lots of NaN. How do I make matlab ignore the NaNs (i.e making them an empty entry, not zero) and still maintain the same size of the data size
채택된 답변
추가 답변 (1개)
It depends on the operation. If you are taking the maximum of each data colum, for example, the NaNs are already ignored, e.g.,
A=randi(500,5,5);
A(A<100)=nan
maximum = max(A)
댓글 수: 6
Opeyemi Kehinde
2021년 12월 5일
Matt J
2021년 12월 6일
No, you can't do that. Some place holder to mark missing data will be present in any Matlab array type.
Walter Roberson
2021년 12월 6일
Well it can be done if it is intended for display only, by constructing a character array and disp() that.
Opeyemi Kehinde
2021년 12월 8일
Walter Roberson
2021년 12월 8일
Suppose that somehow you were able to create a numeric-like matrix that you could do mathematics with, and yet displayed some elements as blanks/nothing. What mathematical properties should be blank/nothing have? For example should [blank*2,5] have the blank be treated as the empty vector, and empty times 2 is empty, and horzcat([], 5) is the scalar 5 ??
Opeyemi Kehinde
2021년 12월 10일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!