Vicky from stackoverflow solved this nicely - Thank you!!:
num_wanted=30;
num_previous=5;
is_match=[ false; A(1:end-1,2)==num_previous & A(2:end,2)==num_wanted ]; %the first element cannot be a match
A(is_match,1)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!