Getting relative time from two events identified as absolute time

5 次查看(过去 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

采纳的回答

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 个)

类别

Help CenterFile Exchange 中查找有关 COM Component Integration 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by