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

1 次查看(过去 30 天)
% 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.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-6-23
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.

更多回答(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