Main Content

find

Find AUTOSAR elements

Since R2023a

Description

modelElementsFound = find(slMap,category) returns an array of handles, paths, or names of model elements of type category.

example

Examples

collapse all

In the Simulink® code mappings of the model autosar_swc, find model workspace parameters.

open_system("autosar_swc");
mapObj = autosar.api.getSimulinkMapping("autosar_swc");
states = find(mapObj,"States")
states = 
"autosar_swc/Integrator"

Input Arguments

collapse all

Simulink to AUTOSAR mapping information for a model, previously returned by slMap = autosar.api.getSimulinkMapping(model)-model is a handle, character vector, or string scalar representing the model.

Example: mapObj

Category of model elements that you search for in the model code mappings, as specified as one of the values listed in this table:

CategoryDescription
"Inports"An array of block handles of Inports present within the specified model
"Outports"An array of block handles of Outports present within the specified model
"Signals"An array of block handles of Signals present within the specified model
"States"A cell array containing the path handle(s) of all States present in the specified model
"DataStores"An array containing the path handle(s) of all Data Stores present in the specified model
"DataTransfers"A cell array containing the block handles of all Data Transfers present in the specified model
"Functions"A string array of the Function names present in the specified model
"FunctionCallers"A cell array containing the block handle(s) of all Function Caller blocks present in the specified model
"ModelParameters"A cell array containing the model parameter names present in the specified model
"ModelParameterArguments"A cell array containing the model parameter argument names present in the specified model

Output Arguments

collapse all

Model elements found, returned as an array of objects, or string vector of object paths or names. Each object or string identifies a model element of the specified category.

CategoryType of Object Returned
Inports, Outports, and SignalsBlock handle
StatesPath handle
DataStoresBlock handle
DataTransfersBlock handle
FunctionsFunction
FunctionCallersBlock handle of Function Caller block
ModelParametersModel parameter name
ModelParameterArgumentsModel parameter argument name

Version History

Introduced in R2023a