How to Interpolate points between a range of data (n X 2) based on values from another vector?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
automycer
el 27 de Oct. de 2016
Respondida: KSSV
el 27 de Oct. de 2016
I'm fairly new to interpolation. So here it is, Three vectors of same length. Vector 'Time' has a constant step size. Vector RPM and Torque does not have relation with other vectors.
The aim is to have multiple points between every interval. The no. of points required to interpolate should be specified by the user (by global parameter). How can I increase the number of points using any of MATLAB's interpolation function ?
I'm not quite sure on how to input the method for this type of interpolation in the function definition.
Thanks in advance! :)
0 comentarios
Respuesta aceptada
KSSV
el 27 de Oct. de 2016
% values in hand
x = linspace(0,2*pi,10) ;
y = sin(x); % y = f(x)
% inteprolation
N = 100 ; % Take any values
xi = linspace(min(x),max(x),N) ;
figure
yi = interp1(x,y,xi);
plot(x,y,'o',xi,yi,':.');
xlim([0 2*pi]);
title('(Default) Linear Interpolation');
doc interp1
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!