how to interpolate nx2 (x,y) matrix include some NaNs with newton's interpolation.

1 visualización (últimos 30 días)
% data1 is loaded data, nx2 matrix
x1 = data1(:,1); % constant time interval, nx1 matrix
y1 = data1(:,2); % data about x, nx1 matrix
x1, y1 is like
x1 = [ 0 5 10 15 20 25 30 35 40 45. . . ]
y1 = [ 0 0 2 3 NaN 11 14 17 NaN 13 . . . ]
how can i interpolate data1 to idata1 with newton's interpolataion (or other interpolation without using interp1).
idata1 is nx2 matrix with all NaNs are replaced by interpolation result.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 23 de Jun. de 2020
Since all points in x1 are equidistant, therefore, it is not really relevant in the interpolation. You can use fillmissing(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/fillmissing.html to replace the NaN values. It gives several different options to replace the missing values.

Más respuestas (0)

Categorías

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

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by