Sample data from time-dependent array

1 次查看(过去 30 天)
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!

采纳的回答

Andrei Bobrov
Andrei Bobrov 2019-9-16
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by