how to combine time series in matlab

23 visualizaciones (últimos 30 días)
Daniel Barzegar
Daniel Barzegar el 17 de Jun. de 2014
Respondida: Pritesh Shah el 17 de Jun. de 2014
I have two time series objects:
Accelerometer, with 591755 samples in the form:
Time X Y Z 1 (space)181135620117(space) 0.21547815 (space)9.740809(space) 0.11133038
2 (space)181140258789(space) -0.027533319(space) 10.150218(space) 0.08738836
3(space) 181145629882(space) -0.22984336(space) 10.376471(space) 0.16519992
...
and, Gyroscope, with the same amount of samples:
Time X Y Z 1 181135620117(space)-0.08841695(space) -0.023435818(space) -0.15233281
2 181140258789(space) -0.09161274(space) -0.027696876(space) -0.15126754
3 181145629882(space) -0.07456851(space) -0.024501082 (space)-0.13209279
...
the time is in nanoseconds. I want to produce a matrix with columns like this:
time X_acc Y_acc Z_acc X_gyro Y_gyro Z_gyro
1 (space) 0
2 (space) 0.005(sec)
3 (space) 0.010
...
I am brand new in Matlab, and I am really struggling with that one. I was told that I can use the resample() function from the timeseries class using 'zoh' interpolation method, but I cannot figure out how to do it.
Also, the input data are a .txt files, the first column is the sample number, the second is the time in nanoseconds, which doesnt start from 0( i want to make it to start from 0 ), and the 3 last columns are coordinates in X, Y, Z axis. The time variable is in nanoseconds, but i want to convert it to be in seconds and also interpolate at 0.005 intervals.. thanks

Respuestas (1)

Pritesh Shah
Pritesh Shah el 17 de Jun. de 2014
[ACC.Time ACC.Data Gyr.Time Gyr.Data] should work

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by