Interpolate columns in matrix that contain NaN values

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Mathieu NOE
Mathieu NOE il 27 Ott 2022
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');

Accedi per commentare.

Risposta accettata

Voss
Voss il 27 Ott 2022

Più risposte (0)

Categorie

Scopri di più su Interpolation 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