A similar one is here.
http://www.mathworks.com/matlabcentral/cody/problems/40-reverse-run-length-encoder
You didn't restrict yourself to using only 0-9 in your sequence, though.
Same as Problem 55 Counting Sequence.
The best solution without regexprep.
506 Solvers
Back to basics 13 - Input variables
235 Solvers
Given a window, how many subsets of a vector sum positive
757 Solvers
383 Solvers
Switch matrix to a column vector
266 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!