Getting relative time from two events identified as absolute time

조회 수: 2 (최근 30일)
Jason
Jason 2025년 2월 10일
댓글: Jason 2025년 2월 10일
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

채택된 답변

Walter Roberson
Walter Roberson 2025년 2월 10일
elapsed_as_duration = datetime(E5) - datetime(E0);
Now you can ask things such as
seconds(elasped_as_duration)

추가 답변 (0개)

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by