Sample data from time-dependent array

2 visualizaciones (últimos 30 días)
Dustin Harper
Dustin Harper el 16 de Sept. de 2019
Comentada: Dustin Harper el 16 de Sept. de 2019
Hi, apologies as I am somewhat new to Matlab.
I have two columns of data in a matrix (time, and an array of temperature data). The data is irregularly spaced in time.
For example (time on left and temp on right):
228.0000 23.7800
236.0000 23.8767
244.0000 23.9400
256.0000 24.1400
268.0000 23.8200
276.0000 24.0700
Using this time-dependent data, I'd like to predict temperature values for a new time array. The new time array is different from the first in that there are repeat times (i.e., 236.0000 below), and new times that did not exist in the first (i.e., 246.0000 below).
For example:
228.0000 ?
236.0000 ?
236.0000 ?
236.0000 ?
244.0000 ?
246.0000 ?
256.0000 ?
268.0000 ?
276.0000 ?
Thanks for the patience and help!

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 16 de Sept. de 2019
data = [ 228.0000 23.7800
236.0000 23.8767
244.0000 23.9400
256.0000 24.1400
268.0000 23.8200
276.0000 24.0700];
data2 = [ 228.0000
236.0000
236.0000
236.0000
244.0000
246.0000
256.0000
268.0000
276.0000 ];
out = interp1(data(:,1),data(:,2),data2);

Más respuestas (0)

Categorías

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

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by