find
Description
returns an array of handles, paths, or names of model elements of type
modelElementsFound
= find(slMap
,category
)category
.
Examples
Find Model States in Simulink Mappings
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
slMap
— Simulink to AUTOSAR mapping information for a model
SimulinkMapping
object
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
— Model element category
"DataStores"
| "DataTransfers"
| "ExportedFunctions"
| "Functions"
| "FunctionCallers"
| "Inports"
| "ModelParameters"
| "ModelParameterArguments"
| "Outports"
| "Signals"
| "States"
Category of model elements that you search for in the model code mappings, as specified as one of the values listed in this table:
Category | Description |
---|---|
"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
modelElementsFound
— Model elements found
array | string vector
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.
Category | Type of Object Returned |
---|---|
Inports, Outports, and Signals | Block handle |
States | Path handle |
DataStores | Block handle |
DataTransfers | Block handle |
Functions | Function |
FunctionCallers | Block handle of Function Caller block |
ModelParameters | Model parameter name |
ModelParameterArguments | Model parameter argument name |
Version History
Introduced in R2023a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)