Conversion of time series- hour resolution to minute resolution!
4 次查看(过去 30 天)
显示 更早的评论
I have a time series of '1' and '0' representing accessibility of the system. Each index of the time series represents an hour (resolution).
Now, instead of having accessibility each hour, I want it for each 6 minutes. To explain the thing I want to achieve, I shall give an example:
- E.g. at 00.00 hrs, the value of accessibility is '1' and at 01.00 hrs, the accessibility goes to '0'. The new vector should consider the following- from 00.06 - 00.30 hrs(5 indices), the value will be '1' and from 00.36 - 1.00 hrs (5 indices) the value is '0'.
How should I formulate a new vector, which could do such an operation?
0 个评论
采纳的回答
更多回答(1 个)
dpb
2014-8-26
编辑:dpb
2014-8-26
>> round(interp1([0 1],[0 1],0:.1:1))
ans =
0 0 0 0 0 1 1 1 1 1 1
>>
Generalize to
x=0:length(series)-1;
y=series;
interpolatedseries=round(interp1(x,y,[0:0.1:x(end)]));
This is in units of hours, of course. If want minutes multiply x by 6 or in actual time, convert to Matlab datenums.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!