Sample data from time-dependent array

1 vue (au cours des 30 derniers jours)
Dustin Harper
Dustin Harper le 16 Sep 2019
Commenté : Dustin Harper le 16 Sep 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!

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 16 Sep 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);

Plus de réponses (0)

Catégories

En savoir plus sur Time Series dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by