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

10 visualizaciones (últimos 30 días)
YZ
YZ el 28 de Oct. de 2014
Comentada: Rajveer Singh el 14 de Sept. de 2018
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.

Respuesta aceptada

Chad Greene
Chad Greene el 28 de Oct. de 2014
Editada: Chad Greene el 28 de Oct. de 2014
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 comentario
Rajveer Singh
Rajveer Singh el 14 de Sept. de 2018
What if I wanted to interpolate in a smaller vector size, say 1by50?
Thanks in advance

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by