%% Round Duration Values
% Round each value in a duration array to the nearest number of seconds.

t = hours(8) + minutes(29:31) + seconds(1.3:0.5:2.3);
t.Format = 'hh:mm:ss.SS'

%

Y1 = round(t)

%
% Round each value in t to the nearest number of hours.

Y2 = round(t,'hours')

% Copyright 2015 The MathWorks, Inc.