Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I interpolate this row?

조회 수: 1 (최근 30일)
Riyadh Muttaleb
Riyadh Muttaleb 2017년 11월 7일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi Everyone, I would like to get your help to interpolate this vector: x=[2 NaN NaN 5 NaN NaN] to fill the messing values
Thanks in advance
Riyadh
  댓글 수: 2
Rik
Rik 2017년 11월 7일
Do you have an estimation of the function that should be used? Because if it is anything other than linear, you have too few values.
Riyadh Muttaleb
Riyadh Muttaleb 2017년 11월 7일
편집: Riyadh Muttaleb 2017년 11월 7일
No. Do you know how can I interpolate one like this[2 3 4 5 NaN NaN]?

답변 (1개)

M
M 2017년 11월 7일
편집: M 2017년 11월 7일
Check if the fillmissing function does what you want. https://mathworks.com/help/matlab/ref/fillmissing.html
  댓글 수: 3
M
M 2017년 11월 7일
편집: M 2017년 11월 7일
You don't have the associated license.
try something like :
nanx = isnan(x);
t = 1:numel(x);
x(nanx) = interp1(t(~nanx), x(~nanx), t(nanx));
Riyadh Muttaleb
Riyadh Muttaleb 2017년 11월 7일
Thank you.. I already did and I had gotten the answer

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by