runlength

Parameters

Parameter label

I/O type

Data type

Mandatory parameter?

Default value

inputVec

input

vector

yes

N/A

boolMask

output

vector

N/A

N/A

segStartIdx

output

vector

N/A

N/A

segLen

output

vector

N/A

N/A

segVal

output

vector

N/A

N/A

Functionality

Module detects segments of constant values in a given vector inputVec. The output variables provide different representations of these segments. The values of boolMask indicate if the next element has a different value. The values of segStartIdx are the start indices of segments with constant values. The segment lengths are stored in segLen and the corresponding values in segVal.

Here is a simple example:

inputVec = [0,0,1,0,1,1,0,1,-1,0]
...
boolMask = [False,True,True,True,False,True,True,True,True,True]
segStartIdx = [0,2,3,4,6,7,8,9]
segVal = [0,1,0,1,0,1,-1,0]
segLen = [2,1,1,2,1,1,1,1]