Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Finding Stateflow Objects

Types of Finder Tools

Two types of finder tools can search for Stateflow objects.

Opening Stateflow Finder

On platforms that do not support the Simulink Find tool, access the Stateflow Finder dialog box with one of these methods:

The Finder operates on the machine whose name appears in the window title area of the Finder dialog box.

Using Stateflow Finder

String Criteria

You specify the string by entering the text to search for in the Look for text box. The search is case sensitive. All text fields are included in the search by default. Alternatively, you can search in specific text fields by using the Look in list box to choose one of these options:

Any.   Search the state and transition labels, object names, and descriptions of the specified object types for the string specified in the Look for field.

Label.   Search the state and transition labels of the specified object types for the string specified in the Look for field.

Name.   Search the Name fields of the specified object types for the string specified in the Look for field.

Description.   Search the Description fields of the specified object types for the string specified in the Look for field.

Document Link.   Search the Document link fields of the specified object types for the string specified in the Look for field.

Custom Code.   Search custom code for the string specified in the Look for field.

Search Method

By default the Search Method is Normal/Wildcard (regular expression). Alternatively, you can click the Exact Word match option if you are searching for a particular sequence of one or more words.

A regular expression is a string composed of letters, numbers, and special symbols that define one or more strings. Some characters have special meaning when used in a regular expression, while other characters are interpreted as themselves. Any other character appearing in a regular expression is ordinary, unless a \ precedes it.

Special characters supported by Stateflow Finder are as follows.

Character

Description

^

Start of string

$

End of string

.

Any character

\

Quote the next character

*

Match zero or more

+

Match one or more

[ ]

Set of characters

Object Type

Specify the object types to search by toggling the check boxes. A check mark indicates that the object is included in the search criteria. By default, all object types are included in the search criteria. Object Types include:

Find Button

Click the Find button to initiate the search operation. The results appear in the display area.

Matches

The Matches field displays the number of objects that match the specified search criteria.

Refine Button

After the results of a search appear, enter additional search criteria and click Refine to narrow the previously entered search criteria. An ampersand (&) is prefixed to the search criteria in the Search History field to indicate a logical AND with any previously specified search criteria.

Search History

The Search History text box displays the current search criteria. Click the pull-down list to display search refinements. An ampersand is prefixed to the search criteria to indicate a logical AND with any previously specified search criteria. You can undo a previously specified search refinement by selecting a previous entry in the search history. By changing the Search History selection, you force the Finder to use the specified criteria as the current, most refined, search output.

Clear Button

Click Clear to clear any previously specified search criteria. By doing so, you remove the results and reset the search criteria to the default settings.

Close Button

Click Close to close the Finder.

Help Button

Click Help to display the Stateflow software documentation in an HTML browser window.

Finder Display Area

The Stateflow Finder display area appears similar to this.

The display area shows matching entries with these columns:

Field

Description

Type

The object type appears in this field. States with exclusive (OR) decomposition are followed by an (O). States with parallel (AND) decomposition are followed by (A).

Label

The string label of the object appears in this field.

Chart

The title of the Stateflow chart appears in this field.

Parent

The parent of this object in the hierarchy.

Source

Source object of a transition.

Destination

Destination object of a transition.

All fields are truncated to maintain column widths. The Parent, Source, and Destination fields are truncated from the left so that the name at the end of the hierarchy is readable. The entire field contents, including the truncated portion, are used for resorting.

Each field label is also a button. Click the button to have the list sorted based on that field. If the same button is pressed twice in a row, the sort ordering is reversed.

You can resize the Finder vertically to display more output rows, but you cannot expand it horizontally.

Click a graphical entry to highlight that object in the Stateflow Editor. Double-click an entry to invoke the Properties dialog box for that object. Right-click the entry to display a menu that allows you to explore, edit, or display the properties of that entry.

Representing Hierarchy

The Stateflow Finder shows Parent, Source, and Destination fields to represent the hierarchy. The Stateflow chart is the root of the hierarchy and is represented by the / character. Each level in the hierarchy is delimited by a period (.) character. The Source and Destination fields use the combination of the tilde (~) and the period (.) characters to denote that the state listed is relative to the Parent hierarchy.

Using the following Stateflow chart as an example, what are the values for the Parent, Source, and Destination fields for the transition from A2a to A2b?

The A2a to A2b transition is within state A2. The parent of state A2 is state A, and the parent of state A is the Stateflow chart itself. The notation for the parent of state A2a is /A.A2. State A2a is the transition source and state A2b is the destination. These states are at the same level in the hierarchy. The relative hierarchy notation for the source of the transition is ~.A2a. The full path is /A.A2.A2a. The relative hierarchy notation for the destination of the transition is ~.A2b. The full path is /A.A2.A2b.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS