In a matrix column/array, how can I turn all numbers higher than a certain value into nans?
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a 1 D array (column) of measured data (that I ultimately append to a matrix). I want to plot the data.
There are numbers higher than "1.0" in the array and they mean that there was a problem with a measurement. I need to turn any numbers higher than 1.0 into nans. Does anyone know how to do this? Thank you for any advice.
댓글 수: 0
채택된 답변
Abdolkarim Mohammadi
2020년 9월 2일
편집: Abdolkarim Mohammadi
2020년 9월 2일
The best way is to use logical indexing.
X(X>1) = NaN;
Read this page, especially Indexing with Logical Values:
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!