Documentation

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.

extractAll

Select all instances of CAN message from message array

Syntax

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

Description

example

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

extracted = extractAll(message,id,extended) parses the given array message, and returns all instances of messages matching the specified ID value and type.

[extracted,remainder] = extractAll(___) assigns to extracted those messages that match the search, and returns to remainder those that do not match.

Examples

collapse all

Extract messages by matching name and IDs.

Extract messages by name.

msgOut = extractAll(msgs,'DoorControlMsg');

Extract all messages with IDs 200 and 5000. Note that 5000 requires an extended style ID.

msgOut = extractAll(msgs,[200 5000],[false true]);

Extract messages and also return the remainder.

[msgOut,remander] = extractAll(msgs,{'DoorControlMsg','WindowControlMsg'});

Input Arguments

collapse all

CAN messages to parse, specified as an array of CAN message objects. This is the collection from which you extract messages by specific names or IDs.

Name of message to extract, specified as a character vector or string.

Example: 'DoorControlMsg'

Data Types: char | string | cell

ID of message to extract, specified as a numeric value or vector. Using this argument also requires that you specify an extended argument.

Example: [200 400]

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

Indication of extended ID type, specified as a logical true or false. Use a value true if the ID type is extended, or false if standard. This argument is required if you specifiy a message ID.

If the message ID is a numeric vector, use a logical vector of the same length for extended.For example, if you specify id and extended as [250 5000],[false true], then extractAll returns all instances of CAN messages 250 and 5000 found within in the message array.

Example: true

Data Types: logical

Output Arguments

collapse all

Extracted CAN messages, returned as an array of CAN message objects. These are the messages whose name or ID matches the specified value.

Unmatched CAN messages, returned as an array of CAN message objects. These are the messages in the original set whose name or ID does not match the specified value.

See Also

Functions

Introduced in R2009a

Was this topic helpful?