Hello, I am trying to find patterns within longer series of data. So far I have done this in a loop, but I need to search larger matrices. Below is a simple example. I have tried to vectorize but so far without success meaning the code did not really get faster - any idea? Is there a matlab build in function which does that?