- #1
MichalXC
- 41
- 0
Hi guys,
I have a long list of numbers which has only two values, e.g. {1,1,1,0,0,1,0,1,0,0,0...}.
The list is ordered as a function of time -- chronologically.
I need to see, then, how long the list stays at 1 before going to 0, and then how long the list stays at 0 before going back to 1... etc. etc. until the list terminates.
In my example above, I would expect an output like {3,2,1,1,1,3}.
How can I implement this?
Thanks.
I have a long list of numbers which has only two values, e.g. {1,1,1,0,0,1,0,1,0,0,0...}.
The list is ordered as a function of time -- chronologically.
I need to see, then, how long the list stays at 1 before going to 0, and then how long the list stays at 0 before going back to 1... etc. etc. until the list terminates.
In my example above, I would expect an output like {3,2,1,1,1,3}.
How can I implement this?
Thanks.