How to use the fillmissing function to interpolate at certain points

조회 수: 2 (최근 30일)
Suppose I have some data at times t = 1:100, with some missing values.
I want to use fill missing function to interpolate only at certain data points e.g. at t = 10,20,30,40,50,60,70,80,90,100.
Sample points argument does not seem to be working.

채택된 답변

Mohammad Sami
Mohammad Sami 2020년 3월 13일
You can directly use interp1 to interpolate at your desired time intervals.
t = 1:100;
v = zeros(1,100); % here v is the value u are interpolating
ti = 10:10:100;
vi = interp1(t,v,ti);
  댓글 수: 2
Swapnil Sayan Saha
Swapnil Sayan Saha 2020년 3월 13일
What if I want to fill up in between, like for example: at [2 3 4], then at [15:25] and so on?
Mohammad Sami
Mohammad Sami 2020년 3월 13일
yes just create a ti vector comprising of the values you need.
ti = [2:4 15:25]; % etc

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by