%% Select Timetable Rows in Closed Time Interval
% Create a timetable.

Time = [seconds(1):seconds(1):seconds(5)];
TT = timetable(Time',[98;97.5;97.9;98.1;97.9],[120;111;119;117;116],...
               'VariableNames',{'Reading1','Reading2'})

%
% Specify a closed time interval between two and four seconds.

S = timerange(seconds(2),seconds(4),'closed')

%
% Select rows with times in the range specified by S. The closed interval includes both the start and end times.

TT2 = TT(S,:)

% Copyright 2012 The MathWorks, Inc.