Borrar filtros
Borrar filtros

Interpolate columns in matrix that contain NaN values

1 visualización (últimos 30 días)
demos serghiou
demos serghiou el 27 de Oct. de 2022
Respondida: Voss el 27 de Oct. de 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 comentario
Mathieu NOE
Mathieu NOE el 27 de Oct. de 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');

Iniciar sesión para comentar.

Respuesta aceptada

Voss
Voss el 27 de Oct. de 2022

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by