%% Aggregate Timetable Data and Calculate Mean Values
% Create a timetable with temperature and pulse readings taken every fifteen minutes.

Time = [minutes(0):minutes(15):minutes(105)]';
Temp = [98;97.5;97.9;98.1;97.9;98;98.3;97.8];
Pulse = [80;75;73;68;69;65;72;71];
TT = timetable(Time,Temp,Pulse)

%
% Calculate the mean for each reading over hourly time bins. When you aggregate data over time bins, the row times of the output timetable are the left edges of the time bins.

TT2 = retime(TT,'hourly','mean')

% Copyright 2012 The MathWorks, Inc.