%% Compare Time Ranges of Timetables
% Create two timetables with different time ranges. The timetables can also have different variables and different numbers of rows.

Intensity = [100;98.7;95.2;101.4;99.1];
TT1 = timetable(Intensity,'TimeStep',seconds(0.1))
Readings = [74;83;99;75;87;93;92];
TT2 = timetable(Readings,'TimeStep',seconds(0.1),'StartTime',seconds(-0.1))

%
% Determine if the range of row times in TT1 is within the range of row times in TT2.

tf = withinrange(TT1,TT2)

%
% And on the other hand, the range of row times of TT2 is not within the range of TT1.

tf = withinrange(TT2,TT1)

% Copyright 2019 The MathWorks, Inc.