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!