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

1 回表示 (過去 30 日間)
Dessa
Dessa 2020 年 6 月 23 日
回答済み: Ameer Hamza 2020 年 6 月 23 日
% 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 Center および File ExchangeInterpolation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by