Interpolate include NaN data.
显示 更早的评论
Data likes this
-----
3
NaN
NaN
7
NaN
NaN
2
NaN
NaN
19
NaN
NaN
12
-----
How interpolate NaN data?
I try interp1 fuction. But I failed.
Please help me.
1 个评论
Jan
2016-11-14
Whenever you post "failed" in the forum, add your code and explain the error.
采纳的回答
更多回答(1 个)
Jan
2016-11-14
data = [3, NaN, NaN, 7, NaN, NaN, 2, NaN, NaN, 19, NaN, NaN, 12];
miss = isnan(data);
data(miss) = interp1(data(~miss), find(~miss), find(miss))
4 个评论
Jeong_evolution
2016-11-14
Jan
2016-11-14
"~" is the NOT operator. Try this:
data = [3, NaN, NaN, 7, NaN, NaN, 2, NaN, NaN, 19, NaN, NaN, 12];
miss = isnan(data);
disp(miss)
disp(~miss)
Jeong_evolution
2016-11-18
Jeong_evolution
2016-11-18
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!