How to Interpolated data outliers
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Matheus Brito
am 2 Mär. 2020
Kommentiert: Matheus Brito
am 9 Mär. 2020
I have a data column that has 3630 rows of data. I used the method: [A, B] = rmoutliers (C, 'movmedian', window); to remove the data outliers.
These data were removed and I need them to be interpolated by the average of the entire column of data. How can I do this?
0 Kommentare
Akzeptierte Antwort
Turlough Hughes
am 2 Mär. 2020
Bearbeitet: Turlough Hughes
am 2 Mär. 2020
Generate some sample data:
C = (1:3630).';
idxout = randperm(3630,500); % random index for outliers
C(idxout) = C(idxout)+2000*(1-2*rand(numel(idxout),1));
Using rmoutliers some of the values are removed:
window = 50;
[A, B] = rmoutliers(C, 'movmedian', window);
Seeing as you've indicated that you only have a column vector of data I assume you want to interpolate using index position as your input for x, you could try the following:
idx = find(~B); % C(idx) is the same as A
D = interp1(idx,A,1:size(C,1)); % Interpolated using index position as x values.
Let me know.
1 Kommentar
Turlough Hughes
am 3 Mär. 2020
Did this work for you? If not I suggest uploadibg the variable C as a .mat
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Interpolation 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!