Find all the sequences of consecutive repeated numbers in a numeric array, returning the indices where each sequence starts and ends. The output is a matrix nx2: the starting indices of the n sequences are in the first column, the ending indices are in the second one.
For example, if x=[0 7 7 3 8 7 1 3 5 5 5], we have that the number '7' appears consecutevely from index 2 to 3, while the number '5' from index 9 to 11, so y = [2 3; 9 11]

Solution Stats

31 Solutions

11 Solvers

Last Solution submitted on Jun 02, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers11

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!