Filter löschen
Filter löschen

How can I get rid of outlier data in matlab?

2 Ansichten (letzte 30 Tage)
Ege Gurtan
Ege Gurtan am 28 Aug. 2017
Beantwortet: KSSV am 28 Aug. 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.

Akzeptierte Antwort

KSSV
KSSV am 28 Aug. 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.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by