In a matrix column/array, how can I turn all numbers higher than a certain value into nans?
2 次查看(过去 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!