New answers tagged

3 votes

Extracting counts of contiguous zeros and ones from a binary array

Using ArrayMesh together with BoundaryMesh ( just a different projection ... ) ...
vindobona's user avatar
  • 3,521
4 votes

Extracting counts of contiguous zeros and ones from a binary array

list = {0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1}; Using PositionIndex, Split and ...
E. Chan-López's user avatar
4 votes

Extracting counts of contiguous zeros and ones from a binary array

Using SequenceCases: x = {0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1}; SequenceCases[x, k : {1 ..} :> Length@k] Using ...
Syed's user avatar
  • 54.1k
5 votes

Extracting counts of contiguous zeros and ones from a binary array

list = {0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1}; Using SequenceSplit (new in 11.3) ...
eldo's user avatar
  • 70.2k

Top 50 recent answers are included