Finding intervals of data from repeated time stamp/marks

조회 수: 1 (최근 30일)
Systematically Neural
Systematically Neural 2018년 10월 16일
댓글: jonas 2018년 10월 16일
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
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
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 CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by