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
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 中查找有关 COM Component Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!