MATLAB: Need to detect repeating values in 2 columns a certain number of times

repeating values

I have a 10000×2 dataset and I need to detect occurrences when the two values repeat at least 3 times in a row. For example:
200,1
300,2
400,1
400,1
400,1
200,2
300,1
300,2
300,2
300,2
300,2
400,2
Should identify the two times that the values of both columns repeated at least 3 times (400,1 and 300,2). The values of each column don't matter, what I am looking for are situations when both columns in a row repeat over at least 3 times in a row. Very much appreciate any advice.

Best Answer

all(data(1:end-2, :) == data(2:end-1,:) & data(2:end-1,:) == data(3:end,:),2)