I have a list
series = [0 1 1 0 1 0 1 0 0 0 1 .....]
I wish to find the indices where two 1's are separated by 2 indices ex. [0 1 0 1] now the location is 1 and 3. Now I wish to do the same for bigger list.
Matlab code for this purpose is
find(conv(series,[1 0 1])==2)