Azzera filtri
Azzera filtri

How can I get rid of outlier data in matlab?

2 visualizzazioni (ultimi 30 giorni)
Ege Gurtan
Ege Gurtan il 28 Ago 2017
Risposto: KSSV il 28 Ago 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.

Risposta accettata

KSSV
KSSV il 28 Ago 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.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by