%% Find Leap Seconds in Time Range
% Determine if any leap seconds were added in the year 2008.
% First, create a timetable of leap seconds.

T = leapseconds

%
% Create a time range object whose start and end times cover the year 2008.

tr = timerange('2008','year')

%
% To return rows of T whose times are within the year 2008, index into T by using tr. When you index into a timetable, you can specify rows by row number or by their row times.

T(tr,:)

% Copyright 2019 The MathWorks, Inc.