Navigation

Operators and Keywords

Function List:

C++ API

: count = runlength (x)
: [count, value] = runlength (x)

Find the lengths of all sequences of common values.

count is a vector with the lengths of each repeated value.

The optional output value contains the value that was repeated in the sequence.

runlength ([2, 2, 0, 4, 4, 4, 0, 1, 1, 1, 1])
⇒  [2, 1, 3, 1, 4]

See also: run_count.

Package: octave