I have an original order of numbers:
x = [2 6 4 3 6 3 4 6 2 6 3 4 2];
And I would like to compare a new vector of numbers:
y = [6 4 2 6 3 4 6 2 6 3 2 4 2 2 6 2];
to the original to get the longest consecutive string of similar numbers. So in the example above, the longest consecutive string will be
6 3 4 6 2 6 3
Thank you!