Finding Max and Min while ignoring a specific range
23 次查看(过去 30 天)
显示 更早的评论
Hi All,
I am trying to find the max/min of a single column of data. Normally I would use the max(X) and min(X), but this particular dataset has spikes I'd like to ignore. The values tend to be roughly -.010 < X < .010, but there are some instantaneous spikes within the data around +/-100. Is there a way to get the max and min while ignoring these spikes?
For example:
If X < 1 AND X > -1 Then max(X) AND min(X) Else Ignore
Hope this makes sense. Thanks in advance for your help! -Marcus
0 个评论
回答(1 个)
Adam
2017-6-13
编辑:Adam
2017-6-13
max( X( X < 0.01 ) )
min( X( X > -0.01 ) )
should work?
3 个评论
Adam
2017-6-14
You could try running a non-aggressive smoothing filter to try to get ride of the outliers, but that will diminish your magnitudes elsewhere too. You can't really do much without getting rid of the erroneous data though.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!