Fill missing NaN values with Interpolation
显示 更早的评论
I have Matlab 2013, and I want to apply spline interpolation in my data matrix with NaN values. Is there any other method which can do this. As fillmissing functon is not available in lower versions.
2 个评论
Adam
2018-7-12
doc spline
doc interp1
Tsehaye Gebreteklie
2022-4-19
knnimpute is prefere than spline. you can write the code like this.
clear all;
clc;
Temp = xlsread(A);
Filldata=knnimpute(Temp);
采纳的回答
更多回答(1 个)
ZaidiN
2018-7-12
0 个投票
1 个评论
Pawan Sharma
2020-5-12
This is liner interpolation. To make it spline interpolation, add spine as a method of interpolation
a(isnan(a)) = interp1(x(~isnan(a)),a(~isnan(a)),x(isnan(a)), 'spline') ;
It do replace NaNs with interpolated values.
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!