Sample data from time-dependent array

조회 수: 1 (최근 30일)
Dustin Harper
Dustin Harper 2019년 9월 16일
댓글: Dustin Harper 2019년 9월 16일
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