MATLAB Answers

0

How can I group a timetable in hours 0-24h

Asked by Antonio Melieni on 23 Apr 2019 at 16:02
Latest activity Commented on by Peter Perkins
on 3 May 2019 at 18:45
Hi,
I have a timetable with tick data of FX rates on a minutely basis.
The timetable is 527040 x 4
Starting from the 01.01.2018 until 01.01.2019
I want to investegate the behaviour of every hour.
So i want the mean of all prices from 00-01 and so on until 23-24.
any ideas?

  0 Comments

Sign in to comment.

1 Answer

Answer by Steven Lord
on 23 Apr 2019 at 16:15

See the "Aggregate Timetable Data and Calculate Mean Values" example on the retime documentation page. While that uses a duration array as the RowTimes for the timetable you can do the same using a timetable with datetime RowTimes as well.

  2 Comments

what I needed was hour = hour(timetable.Time);
Antonio, I think what you needed was
TThourly = retime(TTminutely,'hourly','mean')
but perhaps that's what you meant.

Sign in to comment.