extractTime

Select messages occurring within specified time range from array of messages

Syntax

extracted = extractTime(message, starttime, endtime, msgRange)

Description

extracted = extractTime(message, starttime, endtime, msgRange) parses the array message and returns all messages with a timestamp within the specified starttime and endtime, including the starttime and endtime.

Input Arguments

message

An array of CAN message objects.

starttime

The beginning of the time range in seconds that you specify. Returns messages with a timestamp greater than or equal to the specified start time.

endtime

The end of the time range in seconds that you specify. Parses messages with a timestamp up to the specified end time, including the specified end time.

Output Arguments

extracted

An array of CAN message objects returned with all messages that occur within and including starttime and endtime.

Examples

msgRange = extractTime(message, 5, 10.5)
msgRange = extractTime(message, 0, 60)
msgRange = extractTime(message, 150, Inf)

More About

expand all

Tips

Specify the time range in increasing order from starttime to endtime. If you must specify the largest available time, endtime also accepts Inf as a valid value. The earliest acceptable time you can specify for starttime is 0.

Was this topic helpful?