Hello, I have a 24×1 vector containing 0's,1's and 2's. Shorter example being B = [0 2 2 2 2 0 1 2 2 2]'. As you can see there are four 2's repeated after eachother and then three 2's repeated after eachother, is it possible for me to write a code on Matlab that will tell me that there are four 2's repeated directly after eachother but ignore the three 2's repeated. I can't change the order of the vector as its based on hours in the day data. Many Thanks.
MATLAB: Repetition of values in a vector.
MATLABvectors
Best Answer