How can I get rid of outlier data in matlab?

3 vues (au cours des 30 derniers jours)
Ege Gurtan
Ege Gurtan le 28 Août 2017
Réponse apportée : KSSV le 28 Août 2017
My thermocouple measures temperature in a room. However sometimes it acts weirdly and suddenly it rises from 24 to numbers like 10000.
A= [23.4 24 10000 23.7 24.1 17989]
I want to replace the terms like 10000 and 17989 with their previous neighbour element. Like;
A= [23.4 24 24 23.7 24.1 24.1]
However there are 500 of them. I need a script that makes that automatically for me. For instance a script that finds these "absurd" data and replace it with the previous "non-absurd" neighbour element.

Réponse acceptée

KSSV
KSSV le 28 Août 2017
A= [23.4 24 10000 23.7 24.1 17989] ;
absurdval = 100 ;
idx = find(A>absurdval) ; % Here any record greater thn 100 is absurd
A(idx) = A(idx-1) ;
In the above nay value greater then 100 will be replaced by it's previous value. YOu can fix your absurd value.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by