[ 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 ]
cumsum with reset '3' value and delete repeated values
[ 0 0 0 0 1 0 0 2 0 0 3 0 0 0 1 0 2 0 3 0 0 1 0 0 2 0 0 3 0 0 0 1]
interp1q to fill in 0s
[ 0 0.25 0.5 0.75 1 1.33 1.67 2 2.33 2.67 3 0.33 0.67 1 1.33 1.67 2 2.33 2.67 3 0 0.25 0.5 0.75 1 ]
I tried several ways.., but I can't find a way.
Best Answer