What's wrong if you just do them separately and then see if there is an intersection?
x1 = num2str(rand(1,10)>0.5)
xloc1 = strfind(x1,num2str([1 0 1]))
x2 = num2str(rand(1,10)>0.5)
xloc2 = strfind(x2,num2str([1 0 1]))
intersect(xloc1,xloc2)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!