Watch this Author's files
The way you use recursivity is very interesting and helped me a lot in algorithmic. Thanks!
Interesting code ! I was looking for statistics on run length and it's a good starting point. But you don't mention Stefan Eireiner and use its code even if there are other ways to compute run length which are best for the memory than cell arrays.
Contact us at files@mathworks.com