필터 지우기
필터 지우기

Interpolation incase on nan

조회 수: 1 (최근 30일)
Ede gerlderlands
Ede gerlderlands 2013년 4월 4일
I have a data which includes nans and I used interp1 to interpolate the data points, but error message is popping up which says it's not appropriate .Can anyone help me solving this?

채택된 답변

Jan
Jan 2013년 4월 4일
편집: Jan 2013년 4월 4일
No, currently I can't help. Please post some relevant example data (by editing the original question, not as comment or answer), such that we can see, which of the inputs contains the NaNs and where.
Then an answer will be easy (or impossible): Most likely the NaNs can be simply removed before the interpolation.
[EDITED after your first comment]
Had = [1 3 4 6 nan nan 20 ];
time = [1 2 3 4 5 6 7];
good = ~isnan(Had);
had2 = [ 2.5 5 17]
time2= interp1(Had(good), time(good)', had2);
  댓글 수: 2
Ede gerlderlands
Ede gerlderlands 2013년 4월 4일
편집: Ede gerlderlands 2013년 4월 4일
The data contains long series which can be shortened as;
Had= [1 3 4 6 nan nan 20 ]
time =[1 2 3 4 5 6 7]
had2= [ 2.5 5 17]
time2= interp1(Had,time',had2);
Jan
Jan 2013년 4월 4일
편집: Jan 2013년 4월 4일
Ok, and what do you want as result? As long as you actually do not have a measurement at time=5:6, wouldn't this be a trivial solution: See [EDITED]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by