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.
Find common elements in matrix rows
1275 Solvers
274 Solvers
1270 Solvers
Find the elements of a matrix according to a defined property.
73 Solvers
2961 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!