I've been stuck with subsequent matching of time-series in MATLAB (I'm new to it).
I have two time-series: A (of length a) and B (of length b). Assume that a is much larger than b. The task is to find the closest window from A to B (according to Euclidian metric).
In order to do that I construct additional matrix C that stores all subsequences of the length b from A and then use pdist2(C, B). Obviously it works slowly and requires too much memory.
So I have a couple of questions:
How to obtain C without loops (actually to reshape A)?
What are the common ways to solve this problem? (preferably in MATLAB but other environments are also possible)
Thanks for your help!