Finding intervals of data from repeated time stamp/marks
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
dpb
2018-10-16
编辑:dpb
2018-10-16
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
2018-10-16
Apologies, I posted my answer in the wrong thread. The fact that you've submitted two almost identical questions is a bit confusing.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!