Finding intervals of data from repeated time stamp/marks

1 view (last 30 days)
I have three sets of data times. They contain all the time stamps from a set of data, randomly divided into the three matrices (times_1,times_2, times_3). The recording took time stamps every .001 seconds. Much of these three matrices contain repeating time points, where consecutive .001 second time stamps are together. For those repeating or consecutive time points in each matrix, I would like to convert them into an interval style data point.
For example, if I have [43.5196, 43.5206, 43.5216,43.5226], I would like that to be converted into 43.5196-43.5226 or [43.5196, 43.5226].
Please let me know if there is any way to clarify this anymore!
Thanks for any help!
  7 Comments
dpb
dpb on 16 Oct 2018
Edited: dpb on 16 Oct 2018
Well, after reading the other posting and this one again, you're trying to do something entirely different than what I thought your intent was -- the use of "repeated time" in the Q? title is a real red herring sending the respondent off in totally wrong direction....there are no repeated times at all so grouping by timestamp isn't what are trying to do at all.
accumarray may be more amenable to your task; the other Q? answer to find locations with breaks works.
>> ix=find(diff(t2)>0.001+eps(t2(1))); % find breaks more than rounding error
>> length(t2)/length(ix) % what's average length
ans =
6.9783
>> ix(1:10) % where are first several
ans =
1366
3349
4099
4104
4109
4113
4118
4123
4128
4133
>>
OK, the first 1367 values are consecutive; so what do you want to do with them and what's the result to be? And where's whatever data goes with the timestamps?
jonas
jonas on 16 Oct 2018
Apologies, I posted my answer in the wrong thread. The fact that you've submitted two almost identical questions is a bit confusing.

Sign in to comment.

Answers (0)

Categories

Find more on Descriptive Statistics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!