Effacer les filtres
Effacer les filtres

Interpolate columns in matrix that contain NaN values

1 vue (au cours des 30 derniers jours)
demos serghiou
demos serghiou le 27 Oct 2022
Réponse apportée : Voss le 27 Oct 2022
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 commentaire
Mathieu NOE
Mathieu NOE le 27 Oct 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');

Connectez-vous pour commenter.

Réponse acceptée

Voss
Voss le 27 Oct 2022

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by