MATLAB Answers

how to find the hourly average of datetime series

조회 수: 5(최근 30일)
Daniel Abraham
Daniel Abraham 2021년 7월 28일
댓글: Daniel Abraham 2021년 8월 3일
Hello everyone. I have a datetime series of this form for about 1 month
Dates =datetime(Dates,'InputFormat','dd-MM-yyyy HH:mm:ss')
The variables in the table
Data.Dates
Data.Records1
Data.Records2
I have data for a month at 3 mins intervals.
I visualized plots for the whole time series but I am having troubles visualizing daily averages. 12 to 12 or something like that.
Is it possible to make daily average in hours from this time series into another table with 3 variables?
Thanks in advance

채택된 답변

Scott MacKenzie
Scott MacKenzie 2021년 7월 28일
편집: Scott MacKenzie 2021년 7월 28일
TT1 = table2timetable(Data);
TT2 = retime(TT1, 'hourly', 'mean'); % hourly averages
TT3 = retime(TT1, 'daily', 'mean'); % daily averages
  댓글 수: 3
Daniel Abraham
Daniel Abraham 2021년 8월 3일
thank you, it works perfectly

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by