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!
첫 번째 질문에 대해서는
tmp = repmat(A,1,b);
C = reshape([tmp zeros(1,b)],a,b);
C = C(1:(a-b+1),:);
게다가, pdist2
이 아주 좋은 솔루션에 비해 매우 느립니다. Matlab에서 쌍으로 제곱 된 유클리드 거리를 효율적으로 계산 합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다