How do I adjust this loop to the minute level?
3 次查看(过去 30 天)
显示 更早的评论
So I have part of my code below running through a large Excel sheet of timeseries data to differentiate between average hourly weekend and weekday consumption by pulling the unique hour. I now want to run this again but incorporate the minutes along with the hours. I tried several different ways but to no prevail. Any help would be much appreciated.
for i = 1:length(UniqueTimeSteps)
HourValue(i) = UniqueTimeSteps(i);
[TimeValue,MinValue,Seconds] = hms(UniqueTimeSteps(i));
idx = (t.Hour == TimeValue & weekday(t) > 1 & weekday(t) < 7);
Consumption_Weekday(i) = mean(AptA(idx));
idx = (t.Hour == TimeValue & (weekday(t) == 1 | weekday(t) == 7));
Consumption_Weekend(i) = mean(AptA(idx));
end
3 个评论
回答(0 个)
另请参阅
类别
在 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!