% Play with the Interval class
% Experiment with random intervals
clear all
clc

fprintf('Generate random intervals and check if there is overlap\n')
for k=1:5
fprintf('\nTrial %d\n', k)
a= Interval(3, 3 + rand()*5);
b= Interval(6, 6 + rand()*3);
disp(a)
disp(b)

c= a.overlap(b);
if ~isempty(c)
fprintf('Overlap is ')
disp(c)
else
disp('No overlap')
end
pause
end