MATLAB: Help interpolating irregular time series to regular time series

accelerationinterpolateresampletime series

Hello,
I have irregular time series data: (time, X-acceleration, Y-acceleration, Z-acceleration)
19:24:26.850, -0.11492168, 0.038307227, 9.634268
19:24:26.859, -0.12449849, 0.038307227, 9.662998
19:24:26.872, -0.1340753, 0.05746084, 9.672575
19:24:26.884, -0.12449849, 0.02873042, 9.615114
19:24:26.889, -0.15322891, 0.047884032, 9.643845
19:24:26.902, -0.10534488, 0.06703765, 9.662998
19:24:26.909, -0.076614454, 0.076614454, 9.624691
19:24:26.921, -0.095768064, 0.05746084, 9.653421
19:24:26.935, -0.05746084, 0.095768064, 9.624691
19:24:26.939, -0.06703765, 0.05746084, 9.672575
etc.
How can I interpolate/resample(?) the data so that I can get accelerations every 0.010 seconds? I can add the date to the time string with no problems, I'll even have too soon. Thank you very much!
Oleg

Best Answer

Letting t be column 1 and x be column 2, interpolate values xi corresponding to ti:
ti = yourStartingTime + 0:.010:3; % this represents 3 seconds at 0.010 second intervals.
xi = interp1(t,x,ti);
Related Question