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

63 次查看(过去 30 天)
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