필터 지우기
필터 지우기

Change a half hourly table to hourly time table

조회 수: 2 (최근 30일)
Fraser McMurray
Fraser McMurray 2018년 2월 5일
댓글: Steven Lord 2018년 2월 6일
I have a table which consists of 220 columns of half-hourly values over the course of a year. Is there a way to change the table to hourly values which are the average across two of the half hourly values.

채택된 답변

Walter Roberson
Walter Roberson 2018년 2월 5일
The easiest way is to use a timetable object and the retime() function.
  댓글 수: 3
Peter Perkins
Peter Perkins 2018년 2월 6일
Assuming you have R2016b or later, use table2timetable to create a timetable first, then call retime, using 'hourly'.
Pre-R2016b, you can create a new variable in your table that is your timestamps rounded down to the previous hour (use dateshift), then use varfun and group by that new variable to compute the mean of all the data variables.
Steven Lord
Steven Lord 2018년 2월 6일
The retime function is defined for timetable arrays. It is not defined for table arrays. A timetable is required to contain some date and/or time information by the way it is constructed, while a table is not.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by