Getting relative time from two events identified as absolute time
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I haver a time event (AbsTime) reported as a double and I want to pull out the time since the 1st event (E0)
How can I report out this - thanks
events =
1×6 struct array with fields:
Type
Data
ans =
struct with fields:
AbsTime: [2025.00 2.00 10.00 20.00 16.00 8.34]
FrameNumber: 0
RelativeFrame: 0
TriggerIndex: 0
ans =
struct with fields:
AbsTime: [2025.00 2.00 10.00 20.00 16.00 11.90]
FrameNumber: 0
RelativeFrame: 0
TriggerIndex: 1.00
ans =
struct with fields:
AbsTime: [2025.00 2.00 10.00 20.00 17.00 11.90]
FrameNumber: 1.00
RelativeFrame: 0
TriggerIndex: 2.00
ans =
struct with fields:
AbsTime: [2025.00 2.00 10.00 20.00 18.00 6.60]
FrameNumber: 2.00
RelativeFrame: 0
TriggerIndex: 3.00
ans =
struct with fields:
AbsTime: [2025.00 2.00 10.00 20.00 19.00 1.09]
FrameNumber: 4.00
RelativeFrame: 0
TriggerIndex: 4.00
ans =
struct with fields:
E0 =
2025.00 2.00 10.00 20.00 16.00 8.34
ans =
'double'
E1 =
2025.00 2.00 10.00 20.00 19.00 1.09
ans =
0 0 0 0 3.00 -7.26
>>
This is how I actually get it:(and I Thought (E5-E0) would do it.
events = vid.EventLog %Events log from video object
format bank
E0=events(1).Data.AbsTime
class(E0)
E5=events(5).Data.AbsTime
E5-E0
댓글 수: 0
채택된 답변
Walter Roberson
2025년 2월 10일
elapsed_as_duration = datetime(E5) - datetime(E0);
Now you can ask things such as
seconds(elasped_as_duration)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Acquisition Using Any Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!