MATLAB Answers

Extracting a column of data from a time series

141 views (last 30 days)
J
J on 2 Dec 2012
Commented: Kurt Stewart on 25 Apr 2019
Does anybody have any ideas as to how to split up the time and variable1 columns of a time series so that the variable1 data can be handled independently of the time?
I have created the two time series so that I could use the resample function to make sure the data in time series 1 is taken at the same time as the data in time series 2.
If it is not possible to extract just the variable1 column, does anyone know how to interpolate a column of data so that it contains measurements at the same times as another set of data, where the time is not evenly sampled and the data consist of a very high number of measurements?
One final query: does anybody know whether it is possible to find the gradient of a timeseries?

  1 Comment

José-Luis
José-Luis on 2 Dec 2012
doc diff -> gradient
doc interp1 -> resample

Sign in to comment.

Answers (1)

Kurt Stewart
Kurt Stewart on 18 Jun 2018
If you made a time series named 'position' for instance you can extract the data by doing: position_vector=position.Data;

  2 Comments

Jaydip Davara
Jaydip Davara on 25 Apr 2019
What if I have 2 columns (i.e. Position1 and Position2). How can I access Position1 or Position2 independently?
PS: I tried position.Data:1
position.Data:2 but that didn't work. Let me know if you can help.
Kurt Stewart
Kurt Stewart on 25 Apr 2019
Position1=position.Data(:,1)
Position2=position.Data(:,2)

Sign in to comment.

Sign in to answer this question.