This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


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 within the specified starttime and endtime, including the starttime and endtime.

Input Arguments


Messages, specified as an array of CAN message objects


Beginning of the time range, specified in seconds. Returns messages with a timestamp greater than or equal to the specified start time.


End of the time range, specified in seconds. Returns messages with a timestamp up to and including the specified end time.

Output Arguments


Returned array of CAN message objects whose messages occur within starttime and endtime, inclusive.


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


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.

See Also


Introduced in R2009a

Was this topic helpful?