How to match two curves in time in matlab? -
i new in matlab , face problem. have 2 datasets, let's (t,y1) , (t,y2). measurements of same experiment 2 different methods. there time delay between two. y1 , y2 values should correspond in time. have idea how can this? thank much.
as long time points equal both y1
, y2
, xcorr
should tell when alignment maximal.
[r,lags] = xcorr(y1,y2); [~,idx] = max(r); y2_shift = lags(idx); %// amount of shift needed correct y2
Comments
Post a Comment