This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Select CAN messages occurring within specified time range


extracted = extractTime(message,starttime,endtime)



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


collapse all

Extract messages in first 10 seconds of channel being on.

msgRange = extractTime(msgs,0,10);

Input Arguments

collapse all

CAN messages to parse, specified as an array of CAN message objects. This is the collection from which you extract recent messages.

Time range in seconds, specified as numeric values. The function returns messages with timestamps that fall within the range defined by starttime and endtime, inclusive.

Specify the time range in increasing order from starttime to endtime. If you must specify the largest available time, set endtime to Inf. The earliest time you can specify for starttime is 0.

Example: 0,10

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Extracted CAN messages, returned as an array of CAN message objects. These are the messages within the specified time range.

See Also


Introduced in R2009a