calculate time offset with matlab
%data reading
S1 = Myosinsample3
S2 = Factinsample3
%plot value 1
figure(1)
plot(S1)
title('s_1')
%plot value 2
figure(2)
plot(S2)
title('s_2')
xlabel('Time (s)')
%intercorrelation caclulation
[acor,lag] = xcorr(S1,S2);
%plot intercorrelation result versus time
lag=lag/2
figure(3)
plot(lag,acor)
评论