generate vector from fixed point
Mostrar comentarios más antiguos
I have a 1x35 array, i want to generate a vector 1x31822 interpolating from the 35 points of the first vector, in a way that the two vectors could have the same shape.
which is the best method?
thanks
2 comentarios
Jos (10584)
el 30 de Nov. de 2017
what do you mean by "have the same shape"? Can you give a small example?
matteo avanzi
el 30 de Nov. de 2017
Respuesta aceptada
Más respuestas (1)
Jos (10584)
el 30 de Nov. de 2017
interp1 is your friend. An example:
x = [0 4 7 10]
y = (x-5).^2
xx = linspace(0,10,13)
yy0 = interp1(x,y,xx) % default: linear interpolation
yy1 = interp1(x,y,xx,'pchip')
plot(xx,yy0,'r-',xx,yy1,'g-', x,y,'bo')
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!