How to get full day data from time sample

Hi if I have data like [1 2 3 4 5] at time [1 5 12 15 19] how can I get for example the data at time 2 or 3 or even 24. I tried to plot a graph but could not get the data out from the graph because the xdata and ydata will be similar to the input points. If you can help I would appreciate it. Thank you,

 Respuesta aceptada

Star Strider
Star Strider el 9 de Oct. de 2015
I would use the interp1 function:
time = [1 5 12 15 19];
data = [1 2 3 4 5];
new_data = interp1(time, data, [2 3 24], 'linear', 'extrap');

2 comentarios

rabih Al Ahmadieh
rabih Al Ahmadieh el 9 de Oct. de 2015
Thank you very much
Star Strider
Star Strider el 9 de Oct. de 2015
My pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Oct. de 2015

Comentada:

el 9 de Oct. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by