Ignore anomalies in collection of datasets
1 view (last 30 days)
Show older comments
I want to ignore anomalies in datasets contained within a for loop. However, I'm not sure how to do this where:
- i = number of rows, and my code will step through it to produce an animation made up of >1000 frames. For example:
RPtoT = [RASIS(i,:); RT2(i,:); RT3(i,:)];
LPtoT = [LASIS(i,:); LT0(i,:); LT1(i,:)];
I want to exlude anomolies that cause my markers to jump around. For example, half way through the moving figure, a few markers will suddenly jump from an x position of 2000 to 0 - I want to be able to ignore these, so almost filter the data, but I don't know how to do this and apply it to a lot more data similar to the code displayed above.
for i = 1:1033
if i<10
i = [NaN]; % I want the values contained within i to be neglected if they randomly bounce towards zero
else
i = i;
end
I don't want to have to go through 50+ datasets with a matrices of 1000+ by 3 and set anomalies to NaN, so is there an easier way to do this?
0 Comments
Answers (1)
Steven Lord
on 29 Jun 2020
Preprocess your data to identify, fill, and/or remove outliers. Use the functions in the "Missing Data and Outliers" section on that page or use the Live Editor Task "Clean Outlier Data" also described on that page.
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!