find
Identify specified objects in hierarchy
Syntax
Description
          objArray = find(location,propertyName,propertyValue)location that have a
          property called propertyName with a value of
            propertyValue.
          objArray = find(location,"-regexp",propertyName,propertyValue)propertyName with a
          value that matches the regular expression specified by propertyValue.
          For more information, see Regular Expressions.
          objArray = find(location,"-isa",objectType)location that have the type
          specified by objectType.
          objArray = find(location,"-property",propertyName)
          objArray = find(location,"-method",functionName)
          objArray = find(location,___,logicalOp,___)
- "-and"— Results must match both search criteria.
- "-or"— Results must match at least one of the criteria.
- "-xor"— Results must match exactly one of the criteria.
When using multiple logical operations, -and has the
          highest precedence, while -or and -xor are
          right-associative. If no logical operation is specified, -and is
          assumed.
Examples
Input Arguments
Output Arguments
Tips
- To limit search results based on the value of a subproperty, call - findusing- "-function"and a function handle. For an example, see Find Objects for Which Signal Logging Is Enabled.
- Using the - findfunction on- Simulink.Root,- Simulink.BlockDiagram, or- Stateflow.Machineobjects can return Simulink® objects that match the search criteria you specify. For example, this command can return a Simulink subsystem or block named- ABC:- find(sfroot,"Name","ABC") 
- Opening a main model that refers to a linked Stateflow chart does not guarantee that the Stateflow API can find the linked chart. To access the objects in a linked library chart, first load the library model into the Simulink workspace by performing one of these tasks: - Load the library model by calling the function - load_system(Simulink).
- Call the function - find_system(Simulink) with the- FollowLinksargument set to- on:- find_system(FollowLinks="on");
- View a linked subsystem or block in the main model. 
- Compile or simulate the model. 
 
Version History
Introduced before R2006a