Stateflow    

Finding Objects at Different Levels of Containment

The find method finds objects at the depth of containment within an object that you specify. If you want to limit the containment search depth with the find command, use the depth switch. For example, to find all the objects in State object sA at the first level of containment, use the following command:

Don't forget, however, that the find command always includes the zeroth level of containment, the containing object itself. So, the preceding command also includes state A in the list of objects found. See the reference for the find method in the API Methods Reference.

The findDeep and findShallow methods are special modifications of the find method to find objects at particular depths of containment. For example, the following command returns a collection of all junctions at the first level of containment inside the state A that is represented by State object sA:

The following command returns an array of all transitions inside state A at all levels of containment:

You must always specify an object type when you use the findShallow and findDeep methods.


  Finding Objects Getting and Setting the Properties of Objects