how aggregate duraration and sum it in timetable

2 views (last 30 days)
Hi,
it's a timetable and i want to sum all duration equal:
example:
04/01/2010 2202 1.23
05/01/2010 2202 1.26
......
i want this:
duration value
22:02 2.49 (1.23+1.26)

Accepted Answer

the cyclist
the cyclist on 27 May 2024
Edited: the cyclist on 27 May 2024
Here is one way:
load("matlab_tt2")
TT2.timeOfDay = timeofday(TT2.datt);
equalDurationSum = groupsummary(TT2,"timeOfDay","sum")
equalDurationSum = 657x3 table
timeOfDay GroupCount sum_close1 _________ __________ __________ 00:01:00 3 3542 00:02:00 3 3542.2 00:03:00 2 2370.8 00:04:00 3 3542 00:05:00 2 2357.5 00:06:00 2 2357.5 00:07:00 2 2357.8 00:08:00 2 2370.8 00:09:00 2 2357.5 00:10:00 2 2357.2 00:11:00 3 3541.2 00:12:00 3 3541.5 00:13:00 2 2357.5 00:14:00 2 2357.8 00:15:00 3 3542 00:16:00 3 3542

More Answers (0)

Categories

Find more on Timetables in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!