How to return index of started specific pattern from array/matrix(column/rows)
1 view (last 30 days)
I have vector(matrix column size 1x1500 ) called a, I want to search inside that vector on specific pattern which it's for instance it's ex=[1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0] ;
I want to search through the vector " a " on the pattern ex and if found then return the first index where the pattern ex started inside the vector a.
how can I do that?
what I've done is this:
but it didn't works .. how can I do that? the vector a might including more than one pattern that Im searching for ... so there would be much indexes returned of all the patterns that found inside the vector a.