Skip to content
Prev 285742 / 398502 Next

Counting value changes

Since x consists solely of 0's and 1's this is same as
  sum(diff(x)==1) # 3 in your example

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com