Clear Filters
Clear Filters

Calculating hourly average over several days using retime

3 views (last 30 days)
Hello.
I have a temperature data over the course of 2 weeks, at a sampling rate of 1 sec. I want to calculate the hourly average so that I can see a tendency in temperature change within the day.
I have tried this so far:
TT = array2timetable(TempC,"RowTimes",T);
Hour = retime(TT,"hourly","mean");
but this gives me the outcome of average temperature of the hour of one day, such as:
'2022/06/18 11:00:00' 32.2
'2022/06/18 12:00:00' 31.7
'2022/06/18 13:00:00' 30.8
'2022/06/18 14:00:00' 31.4
My ideal outcome is hourly average of 2 weeks combined. For example, I want the calculations to take average of the temperature at 12pm on June 18, 19, 20,..., so that the final result will show something like 12pm 30℃, 1pm 32℃,...
How should I do this? Thank you in advance!

Answers (1)

Image Analyst
Image Analyst on 12 Nov 2022

Categories

Find more on Timetables in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!