How to interpolate a 1D array to a larger size?

조회 수: 7 (최근 30일)
YZ
YZ 2014년 10월 28일
댓글: Rajveer Singh 2018년 9월 14일
I have a 1by79 array and want to interpolate to a 1by84 array. Is there a way to do this? I checked interp1 (<http://www.mathworks.com/help/matlab/ref/interp1.html>) but don't know how to use this function in my case. Or other ways to achieve my goal? Thank you.

채택된 답변

Chad Greene
Chad Greene 2014년 10월 28일
편집: Chad Greene 2014년 10월 28일
t = linspace(1,10,79);
x = sin(t);
ti = linspace(1,10,84);
xi = interp1(t,x,ti);
plot(t,x,'r.',ti,xi,'b.')
  댓글 수: 1
Rajveer Singh
Rajveer Singh 2018년 9월 14일
What if I wanted to interpolate in a smaller vector size, say 1by50?
Thanks in advance

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

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