Convert hourly temperature data into daily in the specific time interval

4 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by