function idx = reindexing (idx, TT1, TT2)

for i=1:length(idx)
    [ ~,aux] = min (abs(TT1.Time(idx(i)) - TT2.Time));
    idx(i)=aux;
end