Skip to Main Content Skip to Search
Product Documentation

extractAll - Select all instances of message from array of messages

Syntax

[extracted, remainder] = extractAll(message, messagename)
[extracted, remainder] = extractAll(message, id, extended)

Description

[extracted, remainder] = extractAll(message, messagename) parses the given array message, and returns all instances of messages matching the specified message name.

[extracted, remainder] = extractAll(message, id, extended) parses the given array message, and returns all instances of messages matching the specified ID with the specified standard or extended type.

Tips

You can specify id as a cell array of message names or a vector of identifiers. For example, if you pass id in as [250 5000], [false true], extractAll returns every instance of both CAN message 250 and message 5000 that it finds in the message array. If any id in the vector is an extended type, set extended to true and as a vector of the same length as id.

Input Arguments

message

An array of CAN message objects that you specify to parse and find the specified messages by name or ID.

messagename

The name of the message that you specify to extract.

id

The ID of the message that you specify to extract.

extended

Indicates whether the message ID is a standard or extended type. The Boolean value is true if extended and false if standard.

Output Arguments

extracted

An array of CAN message objects returned with all instances of id found in the message.

remainder

A CAN message object containing all messages in the original input message with all instances of id removed.

Examples

[msgOut, remainder]=extractAll(message, 'msg1')
[msgOut, remander]=extractAll(message,{'msg1' 'msg2' 'msg3'})
[msgOut, remainder]=extractAll(message, 3000, true)
[msgOut, remainder]=extractAll(message,[200 5000],[false true])

See Also

extractRecent | extractTime

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS