Convert hourly temperature data into daily in the specific time interval

I have a 3d matrix (81x69x8760). In essence, 8760 is hours of one year or 8784 if it was a leap year. I would like to get daily values from this hourly data. The problem is in this data each day starts at 00:00:00 and ends at 23:00:00 BUT I want to consider day means from 01:00:00 to next day 00:00:00.
For example I have data for this dates below: I would like to use mean of bold line as 01-Jan-2019 data:
'01-Jan-2019 00:00:00'
'01-Jan-2019 01:00:00'
'01-Jan-2019 02:00:00'
'01-Jan-2019 03:00:00'
'01-Jan-2019 04:00:00'
'01-Jan-2019 05:00:00'
'01-Jan-2019 06:00:00'
'01-Jan-2019 07:00:00'
'01-Jan-2019 08:00:00'
'01-Jan-2019 09:00:00'
'01-Jan-2019 10:00:00'
'01-Jan-2019 11:00:00'
'01-Jan-2019 12:00:00'
'01-Jan-2019 13:00:00'
'01-Jan-2019 14:00:00'
'01-Jan-2019 15:00:00'
'01-Jan-2019 16:00:00'
'01-Jan-2019 17:00:00'
'01-Jan-2019 18:00:00'
'01-Jan-2019 19:00:00'
'01-Jan-2019 20:00:00'
'01-Jan-2019 21:00:00'
'01-Jan-2019 22:00:00'
'01-Jan-2019 23:00:00'
'02-Jan-2019 00:00:00'
'02-Jan-2019 01:00:00'
Unfortunatly the original file is too large to attache so I cut a little sample of it.
I want to ask you if you please help me what can I do?
Thanks you !

 채택된 답변

Peng Li
Peng Li 2020년 3월 24일

0 개 추천

If this is in a datetime variable type, how about you offset your original time by 1 hr (e.g., yourVarName - hours(1)). After that you can group them by date and perform average over each group (consider using findgroups function). This can be done easily using splitapply function if this is a table variable.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

BN
2020년 3월 24일

답변:

2020년 3월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by