필터 지우기
필터 지우기

How to do interpolation?

조회 수: 2 (최근 30일)
Rita
Rita 2017년 4월 24일
댓글: Rita 2017년 4월 25일
I have a vector which has daily measured data for some days of a year.for example I have
A=[ 1 1
4 3
7 6
75 0
245 4
300 1
350 0
365 6]
the first column is the day of year and the second column is the measured data.I want to interpolate the second column for the other days of the year.Any suggestion?Thanks
  댓글 수: 2
John Chilleri
John Chilleri 2017년 4월 24일
Hello,
Look into the interp1 command. I believe this will do what you wish.
Hope this helps!
Rita
Rita 2017년 4월 25일
Thanks John

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

채택된 답변

KSSV
KSSV 2017년 4월 25일
A=[ 1 1
4 3
7 6
75 0
245 4
300 1
350 0
365 6] ;
t = A(:,1) ; a = A(:,1) ;
ti = 1:365 ;
ai = interp1(t,a,ti) ;
plot(t,a,'.r') ;
hold on
plot(ti,ai,'b') ;
xlabel('days')
ylabel('value')
legend('Given data', 'interpolated');
  댓글 수: 1
Rita
Rita 2017년 4월 25일
Thanks a lot for your comprehensive answer.

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

추가 답변 (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