I have a set of 1s and 0s. How to count the maximum number of consecutive 1s?
(For example, x = [ 1 1 0 0 1 1 0 0 0 1 0 0 1 1 1 ....] ). Here the answer is 3, since the maximum number of times 1 is 3.
I was looking for some search functions and counting the built-in functions, however I was not successful.
matlab
discipulus
source share