필터 지우기
필터 지우기

Interpolate columns in matrix that contain NaN values

조회 수: 1 (최근 30일)
demos serghiou
demos serghiou 2022년 10월 27일
답변: Voss 2022년 10월 27일
Hi I have this code to interpolate data that is set to NaN. I use the fillmissing function as shown below but it does not do the job very well. Could I replace the fillmissing function with interp function?
idx = abs(R_f) <= 0.8;
mat_up(idx,:) = NaN;
mat_up=fillmissing(mat_up,'linear');
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 10월 27일
hello
what do you see as a problem ?
seems to me there is indeed interpolation and NaNs are removed.
load('R_f.mat');
load('mat_up.mat');
idx = abs(R_f) <= 0.8;
mat_up2 = mat_up;
mat_up2(idx,:) = NaN;
mat_up3=fillmissing(mat_up2,'linear');
err = abs(mat_up - mat_up3);
figure(1);imagesc(err);colorbar('vert');
figure(2);imagesc(double(isnan(err)));colorbar('vert');

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

채택된 답변

Voss
Voss 2022년 10월 27일

추가 답변 (0개)

카테고리

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