Sum up values of corresponding date time intervals.

5 次查看(过去 30 天)
I have an excel sheet with the first column as date in dd:mm:yyyy hh:mm format and the second column with data coresponding to each hour.
I want to sum up the data in particular time period which is recuring.
For example i want to sum the coreesponding data between
for weekdays 12:06:2017 20:00 to 13:06:2017 08:00, and repeat the same for 13:06:2017 20:00 to 14:06:2017 08:00 for the next 180 days.
again repeat same for weekends 09:06:2017 20:00 to 12:06:2017 08:00 repeat this for the next 180 days again.
sum up the total values for weekdays and weekends.

回答(1 个)

KSSV
KSSV 2021-4-7
You can find the respective date indices using find or logical indexing. Once you know the first date and last date indices, you can do what you want.

Community Treasure Hunt

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

Start Hunting!

Translated by