필터 지우기
필터 지우기

How to Interpolated data outliers

조회 수: 2 (최근 30일)
Matheus Brito
Matheus Brito 2020년 3월 2일
댓글: Matheus Brito 2020년 3월 9일
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?

채택된 답변

Turlough Hughes
Turlough Hughes 2020년 3월 2일
편집: Turlough Hughes 2020년 3월 2일
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
Turlough Hughes
Turlough Hughes 2020년 3월 3일
Did this work for you? If not I suggest uploadibg the variable C as a .mat

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matheus Brito
Matheus Brito 2020년 3월 4일
Hi Turlough
Yes, it worked very well and I was able to perform the procedures I needed.
Thank you!
  댓글 수: 3
Matheus Brito
Matheus Brito 2020년 3월 4일
Done!
Matheus Brito
Matheus Brito 2020년 3월 9일
Hi Turlough Hughes, how are you?
Can you help me again? After interpolation, in some cases matlab gave me the following information:
Error using eig
Input matrix contains NaN or Inf.
Do you know why this may be happening? And how can I solve this? So to calculate some variables such as area, amplitude, frequency and others?
Thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by