I tried to calculate the xcorr using a for loop and i got the 'subscript mismatch error'.
The code looks like:
for k = 2:numel(rep) X(k) = xcorr(wg1(:,1),wg1(:,k)); L = length(wg1(:,1)); [m(k),d(k)]=max(X(k)); delay (k) = d(k)-max(L); tX(k)=[delay(k)+1:length(wg1(:,k))+delay(k)]./Fs; end
Any ideas? Cheers!
Best Answer