seqdss function

Extract sequences of distinct successive states