It depends on what the data are (for example, datetime arrays).
Given the problem described —
Months = repmat(ones(3,1) * (1:12), 1, 5);
Data = [Months(:) (1:numel(Months)).']
% Check1 = Data(24:36,:)
Result = Data(6 <= Data(:,1) & Data(:,1) <= 8, :)
Check2 = Result(28:36,:)
There are other approaches as well. this is likely the simplest.
.