Ignore anomalies in data sets
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone
I want to import a data set and graph it, but after graphing I notice some anomalies in my data set causing an a number of values to significantly differ from the rest. ![HALLLLAO 2019-08-28 at 7.45.14 pm.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235537/HALLLLAO%202019-08-28%20at%207.45.14%20pm.png)
![HALLLLAO 2019-08-28 at 7.45.14 pm.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235537/HALLLLAO%202019-08-28%20at%207.45.14%20pm.png)
I'm wondering if there is a way I can ignore the faulty values to improve my graph's accuracy. Going through them one by one is impractical since there is more than 6000 cells to go though :( ...
Thank you very much
采纳的回答
Ted Shultz
2019-8-28
Do you have a rule that you can apply to define when a value should be ignored? (Above a certain value? distance from previous/next value?
If so, then the code could look like this:
%allData = readData
badDataIndex = allData > 10^4; % find locations of bad data
allData = allData(~badDataIndex); % drop any data that is bad
this could be done in one line as well:
allData = allData(allData<10^4); % drop any data that is above threshold
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!