The Model Explorer

Introduction to the Model Explorer

The Model Explorer allows you to quickly locate, view, and change elements of a Simulink® model or Stateflow® chart. To display the Model Explorer, select Model Explorer from the Simulink View menu or select an object in the block diagram and select Explore from its context menu. The Model Explorer appears.

The Model Explorer includes the following components:

You can use the Model Explorer's View menu to hide the Dialog pane and the toolbars, thereby making more room for the other panes.

Model Hierarchy Pane

The Model Hierarchy pane displays a tree-structured view of the Simulink model hierarchy.

Simulink® Root

The first node in the view represents the Simulink root. Expanding the root node displays nodes representing the MATLAB® workspace (the Simulink base workspace) and each model and library loaded in the current session.

Base Workspace

This node represents the MATLAB workspace. The MATLAB workspace is the base workspace for Simulink models. Variables defined in this workspace are visible to all open Simulink models, i.e., to all models whose nodes appear beneath the Base Workspace node in the Model Hierarchy pane.

Configuration Preferences

If you check the Show Configuration Preferences option on the Model Explorer's View menu, the expanded Simulink Root node also displays a Configuration Preferences node. Selecting this node displays the preferred model configuration (see Configuration Sets) for new models in the adjacent panes. You can change the preferred configuration by editing the displayed settings and using the Model Configuration Preferences dialog box to save the settings (see Model Configuration Preferences Dialog).

Model Nodes

Expanding a model node displays nodes representing the model's configuration sets (see Configuration Sets), top-level subsystems, model references, and Stateflow charts. Expanding a node representing a subsystem displays its subsystems, if any. Expanding a node representing a Stateflow chart displays the chart's top-level states. Expanding a node representing a state shows its substates.

Displaying Node Contents

To display the contents of an object displayed in the Model Hierarchy pane (e.g., a model or configuration set) in the adjacent Contents pane, select the object. To open a graphical object (e.g., a model, subsystem, or chart) in an editor window, right-click the object. A context menu appears. Select Open from the context menu. To open an object's properties dialog, select Properties from the object's context menu or from the Edit menu. See Configuration Sets for information on using the Model Hierarchy pane to delete, move, and copy configuration sets from one model to another.

Expanding Model References

To expand a node representing a model reference (see Referencing a Model), you must first open the referenced model. To do this, right-click on the node to display its context menu, then select Open Model from the menu. The model to which the reference refers to is then opened, a node for it is displayed in the Model Hierarchy pane, and all references to the model are made expandable. You cannot edit the contents of a reference node, however. To edit the referenced model, you must expand its node.

Contents Pane

The Contents pane displays either of two tabular views selectable by tabs. The Contents tab displays the contents of the object selected in the Model Hierarchy pane. The Search Results tab displays the results of a search operation (see Search Bar) .

In both views, the table rows correspond to objects (e.g., blocks or states); the table columns, to object properties (e.g., name and type). The table cells display the values of the properties of the objects contained by the object selected in the Model Hierarchy pane or found by a search operation.

The objects and properties displayed in the Contents pane depend on the type of object (e.g., subsystem, chart, or configuration set) selected in the Model Hierarchy pane. For example, if the object selected in the Model Hierarchy pane is a model or subsystem, the Contents pane by default displays the name and type of the top-level blocks contained by that model or subsystem. If the selected object is a Stateflow chart or state, the Contents pane by default shows the name, scope, and other properties of the events and data that make up the chart or state.

Customize Contents Pane

The Customize Contents pane allows you to select the properties that the Contents pane displays for the object selected in the Model Hierarchy pane. When visible, the pane appears in the lower-left corner of the Model Explorer window.

A splitter divides the Customize Contents pane from the Model Hierarchy pane above it. Drag the splitter up or down to adjust the relative size of the two panes.

The Customize Contents pane contains a tree-structured property list. The list's top-level nodes group object properties into the following categories:

By default, the Contents pane displays a standard subset of properties for the currently selected model. The Customize Contents pane allows you to perform the following customizations:

Customizing the Contents Pane

The Model Explorer's View menu allows you to control the type of objects and properties displayed in the Contents pane.

Reordering the Contents Pane

The Contents pane by default displays its contents in ascending order by name. To order the contents in ascending order by any other displayed property, click the head of the column that displays the property. To change the order from ascending to descending, or vice versa, click the head of the property column that determines the current order.

Marking Nonexistent Properties

Some of the properties that the Contents pane is configured to display may not apply to all the objects currently listed in the Contents pane. You can configure the Model Explorer to indicate the inapplicable properties.

To do this, select Mark Nonexistent Properties from the Model Explorer's View menu. The Model Explorer now displays dashes for the values of properties that do not apply to the objects displayed in the Contents pane.

Changing Property Values

You can change modifiable properties displayed in the Contents pane (e.g., a block's name) by editing the displayed value. To edit a displayed value, first select the row that contains it. Then click the value. An edit control replaces the displayed value (e.g., an edit field for text values or a pull-down list for a range of values). Use the edit control to change the value of the selected property.

To assign the same property value to multiple objects displayed in the Contents pane, select the objects and then change one of the selected objects to have the new property value. The Model Explorer assigns the new property value to the other selected objects as well.

Dialog Pane

Use the Dialog pane to view and change properties of the blocks or signals in your model.

  1. To show the Dialog pane, select Dialog View from the View menu, located on the Model Explorer's main toolbar.

  2. In the Contents pane, select an object (such as a block or signal). The properties are displayed in the Dialog pane.

  3. Change a property (for example, the gain of a gain block) in the Dialog pane.

  4. Click Apply to accept the change, or click Revert to return to the original value.

By default, clicking outside a dialog with unapplied changes causes the Model Explorer – Apply Changes dialog box to appear:

Click OK to accept the changes, Ignore to revert to the original settings, or Cancel to dismiss the dialog box without making any changes.

To suppress this dialog box in the future, check Never ask me again on the dialog box, or check Auto Apply/Ignore Dialog Changes on the Model Explorer Tools menu.

If you suppress the dialog box, and thereafter click outside a dialog that has unapplied changes, the Model Explorer automatically applies or discards changes, depending on which action you most recently chose in the dialog box. You can re-enable the dialog box for future operations by unchecking Tools > Auto Apply/Ignore Dialog Changes.

Main Toolbar

The Model Explorer's main toolbar appears near the top of the Model Explorer window under the Model Explorer's menu.

The toolbar contains buttons that select commonly used Model Explorer commands:

ButtonUsage

Create a new model.

Open an existing model.

Cut the objects (e.g., variables) selected in the Contents pane from the object (e.g., a workspace) selected in the Model Hierarchy pane. Save a copy of the object on the system clipboard.

Copy the objects selected in the Contents pane to the system clipboard.

Paste objects from the clipboard into the object selected in the Model Explorer's Model Hierarchy pane.

Delete the objects selected in the Contents pane from the object selected in the Model Hierarchy pane.

Add a MATLAB variable to the workspace selected in the Model Hierarchy pane.

Add a Simulink.Parameter object to the workspace selected in the Model Hierarchy pane.

Add a Simulink.Signal object to the workspace selected in the Model Hierarchy pane.

Add a configuration set to the model selected in the Model Hierarchy pane.

Add a Stateflow datum to the machine or chart selected in the Model Hierarchy pane.

Add a Stateflow event to the machine or chart selected in the Model Hierarchy pane or to the state selected in the Model Explorer.

Add a code generation target to the model selected in the Model Hierarchy pane.

Turn the Model Explorer's Dialog pane on or off.

Customize the Model Explorer's Contents pane.

Bring the MATLAB desktop to the front.

Display the Simulink Library Browser.

To show or hide the main toolbar, select Main Toolbar from the Model Explorer's View menu.

Search Bar

The Model Explorer's search bar allows you to select, configure, and initiate searches of the object selected in the Model Hierarchy pane. It appears at the top of the Model Explorer window.

To show or hide the search bar, check or uncheck Search Bar in the Model Explorer's View > Toolbars menu.

The search bar includes the following controls:

Search Type

Specifies the type of search to be performed. Options include:

Search Options

Specifies options that apply to the current search. The options include:

Search Button

Initiates the search specified by the current settings of the search bar on the object selected in the Model Explorer's Model Hierarchy pane. The Model Explorer displays the results of the search in the tabbed Search Results pane.

You can edit the results displayed in the Search Results pane. For example, to change all objects found by a search to have the same property value, select the objects in the Search Results pane and change one of them to have the new property value.

Refining a Search

To refine the previous search, check the Refine Search option on the search bar's Search Options menu. A Refine button replaces the Search button on the search bar. Use the search bar to define new search criteria and then click the Refine button. The Model Explorer searches for objects that match the previous search criteria and the new criteria.

Setting the Model Explorer's Font Size

You use Model Explorer to change the font size used in the Simulink dialog boxes and in Model Explorer.

To change the font size used in Model Explorer and in the Simulink Dialog boxes, first open Model Explorer (see The Model Explorer).

  


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