View, modify, and add elements of Simulink models, Stateflow charts, and workspace variables
Use the Model Explorer to view, modify, and add elements of Simulink models, Stateflow® charts, and workspace variables
The Model Explorer lets you focus on specific elements (for example, blocks, signals, and properties) without navigating through the model or chart.
Use the Model Explorer to search for:
Variables in workspaces and data dictionaries
Variable usage in a model
Instances of a type of block
Block parameters and parameter values
Using your search results, you can apply changes to multiple elements at once.
To manipulate model data (block parameters, signals, and states) in a searchable, sortable table, consider using the Model Data Editor. You can specify data attributes such as parameter values, signal names, and initial values for states. See Configure Data Properties by Using the Model Data Editor.
To create, modify, and view the entries in a data dictionary, use the Model Explorer. See Edit and Manage Workspace Variables by Using Model Explorer and View and Revert Changes to Dictionary Data.
If a standard view does not meet your needs, you can either modify the view or create a new view.
You can customize the object property table represented by the current view. As you modify the object property table, you change the current view definition.
The Model Explorer saves the following changes to the object property table as part of the column view definition:
Grouping by property
Sorting in a column
Changing the order of property columns
Adding a property column
Hiding and removing property columns
When you change from one view to another view, the Model Explorer saves any customizations that you have made to the previous view.
For example, suppose you use the
Block Data Types view and you remove
LockScale property column. If you then switch to use the
Data Objects view, and later use the
Types view again, the
Block Data Types view no longer
LockScale column that you deleted.
At the end of a Simulink session, the Model Explorer saves the view customizations that you made during that session. When you reopen the Model Explorer, Simulink uses the customized view, reflecting any changes that you made to the view in the previous session.
You can change the font size in the Model Explorer panes:
To increase the font size, press the Ctrl + Plus Sign (+).
Alternatively, from the Model Explorer View menu, select Increase Font Size.
To decrease the font size, press the Ctrl + Minus Sign (-).
Alternatively, from the Model Explorer View menu, select Decrease Font Size.
The changes remain in effect for the Model Explorer and in the Simulink dialog boxes across Simulink sessions.
To create a new view that has a new name, you can use one of these approaches:
Copy an existing view, rename it, and customize the view.
Create a completely new view.
After you create a new view, you can customize it.
|Copying and renaming an existing view|
You can build a new view by copying an existing view, renaming it, and optionally customizing the renamed view. In the View Manager dialog box:
|Creating a completely new view|
To create a completely view, in the View Manager dialog box, click the New button. A new view row appears at the bottom of the View Manager dialog box list of views.
|Naming and describing a new view|
Once you create a view, you can name the view and provide a description of the view:
You can reset (restore) the original definition of a specific standard view (that is, a view shipped with the Model Explorer) if that view is the current view. To do so, click the Options button in the column view details section and select Reset This View to Factory Settings.
To reset the factory settings for all standard views in one step, in the View Manager dialog box, click the Options button and select Reset All Views to Factory Settings.
When you reset all views, the Model Explorer removes all the custom views you have created. Before you reset views to factory settings, export any views that you will want to use in the future.
By default, the Model Explorer displays objects for the system that you select in the Model Hierarchy pane. It does not display data for child systems. You can override that default, so that the Model Explorer displays objects for the whole hierarchy of the currently selected system. To toggle between displaying only the current system and displaying the whole system hierarchy of the current system, use one of these techniques:
Select View > Show Current System and Below.
Click the Show Current System and Below button at the top of the Contents pane.
When you select the Show Current System and Below option:
The Model Hierarchy pane highlights in pale blue the current system and its child systems.
After the path in the Contents of field, the text
The appearance of the Show Current System and Below button at the top of the Contents pane and in the View menu changes.
The status bar indicates the scope of the displayed objects when you hover over the Show Current System and Below button.
Loading very large models for the current system and below can be slow. To stop the loading process at any time, either click the Show Current System and Below button or click another node in the tree hierarchy.
If you show the current system and below, you might want to change the view to better reflect the displayed system contents.
The setting for the Show Current System and Below option is persistent across Simulink sessions.
By default, the Model Explorer does not display the contents of linked library subsystems or masked subsystems in the Model Hierarchy pane. To display the contents of linked library subsystems, use one of these approaches:
At the top of the Model Hierarchy pane, click the Show/Hide Library Links button or the Show/Hide Masked Subsystems button .
From the View menu, select Show Library Links or Show Masked Subsystems.
Library-linked subsystems and masked subsystems are visible in the Contents pane, regardless of how you configure the Model Hierarchy pane.
Search does not find elements in linked library or masked subsystems that are not displayed in the Model Hierarchy pane.
For subsystems that are both library-linked and masked, how you set the linked library subsystems and masked subsystems options affects which subsystems appear in the Model Hierarchy pane, as described in the following table.
|Settings||Subsystems Displayed in the Model Hierarchy Pane|
Show Library Links
Hide Masked Subsystems
Only library-linked, unmasked subsystems
Hide Library Links
Show Masked Subsystems
Only masked subsystems that are not library-linked subsystems
Show Library Links
Show Masked Subsystems
All library-linked or masked subsystems
To open a graphical object (for example, a model, subsystem, or chart) in an editor window, right-click the object in the Model Hierarchy pane, then select Open.
You can use the Model Explorer to add many kinds of objects to a model, chart, or workspace. The types of objects that you can add depend on the node that you select in the Model Hierarchy pane. Use toolbar buttons or the Add menu to add objects. The Add menu lists the types of objects you can add.
As you explore a model or chart, you might want to narrow the contents that you see in the Model Explorer to particular elements of a model or chart. You can use several different techniques. The table summarizes techniques for controlling the content the Model Explorer displays and how the contents appear.
|Technique||When to Use|
Show partial or whole model hierarchy contents
To control how much of a hierarchical model to display
Use the Row Filter option
To focus on, or hide, a specific kind of a model object, such as signals
To find objects that might not be currently displayed
To focus on specific objects in the Contents pane, based on a search string
Once you have the general set of data that you are interested in, you can use the following techniques to organize the display of contents.
|Technique||When to Use|
To quickly organize data for a property in ascending or descending order
Group by property column
To logically group data based on values for a property
Use column views
To display a named subset of property columns to apply to different kinds of nodes in the Model Hierarchy pane
Add, delete, or rearrange property table columns
To customize property columns
Model Explorer helps you to explore and modify your model using advanced techniques. Use the Model Explorer for to search for:
Variables in workspaces and data dictionaries
Variable usage in a model
Instances of a type of block
Block parameters and parameter values
You can combine search criteria and iteratively refine the results. Search in Model Explorer for model elements, starting with the node you select in the model hierarchy. You can search the entire model, in a particular system, or in a system and all the systems below it in the hierarchy.
Using your search results, you can apply changes to multiple elements at once.
To modify algorithmic block parameters such as the Gain parameter of a Gain block, consider using the Model Data Editor. See Configure Data Properties by Using the Model Data Editor.
From the Simulink Editor Modeling tab, click Model Explorer.
In an open model in the Simulink Editor, right-click a block and from the context menu, select Explore.
In an open Stateflow chart, right-click in the drawing area and from the context menu, select Explore.
Use this workflow to view and edit object properties.
To specify whether to display only the current system or the whole system hierarchy, select the model in the Model Hierarchy pane.
Control the model information the Contents pane displays:
Control which property columns to display using the View > Column View option.
Control which types of objects to display using the View > Row Filter option.
Directly manipulate column headings
Identify model elements with specific values using the search bar.
Edit the values for model elements, in either the Contents pane or the Dialog pane. To edit workspace variables, you can use the Variable Editor.
To open a properties dialog box for an object in the Model Hierarchy pane, right-click the object, and select Properties. Alternatively, click an object and from the Edit menu, select Properties.
You can change modifiable properties in the Contents pane (for example, a block name) by editing the displayed value. To edit a value, first select the row that contains the value, and then click the value. An edit control replaces the value (for example, an edit field for text values or a list for a range of values). For workspace variables that are arrays or structures, you can use the Variable Editor. Use the edit control to change the value of the selected property.
To assign the same property value to multiple objects in the
Contents pane, select the objects and then change one of the
selected objects to have the new property value. An edit control replaces the value with
<edit>, indicating that you are doing batch editing. The
Model Explorer assigns the new property value to the other selected objects, as well.
You can also change property values using the Dialog pane.
Use these steps delete a view from the Column View list of views.
In the View Manager dialog box, select one or more views that you want to remove from the list.
Click the Delete button or the Delete key.
Deleting a view using the View Manager dialog box permanently deletes that view from the Model Explorer interface. If you think you or someone else might want to use a view again, consider exporting the view before you delete it.
Use these steps change the position of a view in the Column View list, in the View Manager dialog box.
Select one or more views that you wish to move up or down one row in the table of views.
Click the up or down arrow buttons to the right of the table of views. Repeat this step until the view appears where you want it to be in the table.
Use these steps export views that you or others can then import, in the View Manager dialog box.
In the View Manager dialog box, select one or more views that you want to export.
Click the Export button. An Export Views dialog box opens, with check marks next to the views that you selected.
Click OK. An Export to File Name dialog box opens.
Navigate to the folder to which you want to export the view. By default, the Model Explorer exports views to the MATLAB® current folder.
Specify the file name for the exported view. The file format is
Use these steps to import view files from another location for use by the Model Explorer.
In the View Manager dialog box, click the Import button. The
.mat File to Import dialog box opens.
Navigate to the folder from which you want to import the view.
Select the MAT-file containing the view that you want to import and then click Open. A confirmation dialog box opens. Click OK to import the view.
The imported view appears at the bottom of the Column View list of views. The Model Explorer automatically renames the view if a name conflict occurs.
To browse a model that includes Model blocks, you can expand the Model Hierarchy pane nodes of the Model blocks.
For example, the
includes Model blocks that reference other models. If you open the
sldemo_mdlref_depgraph model and expand that model node in the
Model Hierarchy pane, you see that the model contains several Model
To browse a model referenced by a Model block:
Right-click the referenced model node in the Model Hierarchy pane.
Select Open Model.
The referenced model opens.
The Model Hierarchy pane indicates that you can expand the Model block node (read-only).
The Contents pane displays objects corresponding to the Model block node (read-only).
The Model Hierarchy pane displays a separate expandable node for the referenced model.
For example, if you right-click the
heat2cost Model block node
and select Open Model, the Contents pane
displays the objects corresponding to the
heat2cost Model block. You
can expand the
You can browse the contents of the referenced model, but you cannot edit the model objects that are inside the Model block.
To edit the referenced model, expand the referenced model node in the
Model Hierarchy pane, and then you access the properties of
objects in the referenced model. For example, expand the
For information about referenced models, see Model References.
This example shows how to cut, copy, and paste workspace objects from one workspace into another workspace.
In the Contents pane, right-click on the workspace object you want to cut or copy.
Select Cut or Copy.
You can also cut a workspace object by selecting in the Contents pane Edit > Cut or by clicking the Cut button.
You can also copy a workspace object by selecting Edit > Copy or by clicking the Copy button.
If you want to paste the workspace object that you cut or copied, in the Model Hierarchy pane, right-click the workspace into which you want to paste the object, and select Paste.
You can also paste the object by selecting Edit > Paste or by clicking the Paste button.
When you copy and paste (or drag and drop), you can manage the resolution of name conflicts. In the dialog box, choose an action for each item whose name conflicts with an existing item.
Skip — Default action when the conflicting items have
the same value.
Replace — Default action when the conflicting items
have different values.
Keep both — Preserve both copies. The name given to the
copied item follows the naming rules that are used in the MATLAB workspace.
If the source and destination are the same, the software resolves the name conflict by following the naming rules that are used in the MATLAB workspace.
You can also cut, copy, and paste by selecting an object and performing drag and drop operations.
In this example, you search for model elements that have an Integer rounding mode parameter. You then refine the results to include only n-D Lookup table blocks. You can use the search results to find out more about how these values are set or make batch changes to the model elements found by the search.
Open the model
Open Model Explorer. On the Modeling tab, click Model Explorer.
By default, the Model Explorer searches the current system and below. You can use the model hierarchy tree in combination with the Show contents button to specify the scope of the search. For example, you can select a node and set the search to current system only to keep the search only at that level. Set the search to current system and below to search the current system and all the subsystems within it.
For this example, leave the search scope set to search the current system and below, starting with the top level of the model. Specify your search criteria. In the search bar, set:
Rounding is the programmatic name for the Integer
rounding mode parameter. For a list of these names, see Block-Specific Parameters.
Click Search. In the Search Results box, 43 results appear. You can go to an item by clicking the link to the path.
Refine the search. In the search bar, click Search Options and select Refine Search.
The search button label changes to Refine. With this label in effect, additional search criteria act on the previous set of results.
Set Search to
by Block Type and set
The search returns 5 items.
To work further with the values, click Show Details.
The property you are interested in learning more about or acting on is
Rounding. First add a column for it in the search results. Select
Rounding from the list (you can enter it in the Find
Properties box to locate it quickly), and click the Display
property as column in view button.
A column for
Rounding appears in the search results. For any
parameter or property that appears in a column, you can view, sort, and change values
for multiple items. For example, to change the
Rounding values on all
n-D Lookup Table blocks you find by searching, select all the items in
the list. In the Rounding column, click one cell and select a new
value from the list (for example,
To view a summary of the search options that you used, expand the Number of objects found box by clicking the Show Search Details button.
You can use the Model Explorer to create, modify, and view the entries in a data dictionary. See Edit and Manage Workspace Variables by Using Model Explorer and View and Revert Changes to Dictionary Data.
Search Bar— Search for model elements, starting with the node you select in the model hierarchy
Open the search bar using the View > Toolbars > Search Bar option. The search bar includes these controls: Search Type and Search Options.
Search Type— Specify the type of objects or properties to include in the search
Use the Search Type control to specify the type of objects or properties to include in the search.
|Search Type Option||Description|
|Searches a model or chart for all objects that have the specified string in the name of the object.|
|Searches for objects that have a specified property. Specify the target property name from a list of properties that objects in the search domain can have.|
Searches for objects with a property value that matches the value you specify. Specify the name of the property, the value to be matched, and the type of match (for example, equals, less than, or greater than).
Searches for blocks of a specified block type. Select the target block type from the list of types contained in the currently selected model.
Searches for Stateflow objects of a specified type.
Searches for blocks that use variables defined in a workspace. Select the base workspace or a model workspace (model name) and, optionally, the name of a variable.
Searches for variables that a model or block uses. Specify the name of the model or block in the by System field. The model or block must be in the Model Hierarchy pane.
Searches for variables that are defined in a workspace but not used by any model or block. Select the name of the workspace from the drop-down list for the in Workspace field.
Searches for library links in the current model.
Searches for Simulink objects of a specified class.
Searches a model for all blocks that support fixed-point computations.
Searches a model for references to other models.
Searches a model for all objects whose dialogs contain the prompt you specify.
Searches a model for all objects in which the string you specify occurs.
Search Options— Specify search strings
Use the Search Options control to specify the scope and how to apply search strings.
|Match Whole String|
Do not allow partial string matches (for example, do not allow
Considers case when matching strings (for example,
Considers a string to be matched as a regular expression.
|Evaluate Property Values During Search|
Applies only for searches by property value. If enabled, Model Explorer evaluates the value of each property as a MATLAB expression and compares the result to the search value. If this option is disabled (the default), the Model Explorer compares the unevaluated property value to the search value.
Initiates a secondary search that provides additional search criteria to refine the initial search results. The second search operation searches for objects that meet both the original and the new search criteria.
By default, search strings are case-insensitive and are treated as regular
expressions and the search allows partial string matches. You cannot use wildcard
characters in search strings. For example, if you enter
*1 as a name
search string, you get no search results unless there is an item whose name starts with
the two characters
*1. If there is an
the search results do not include that item.
Simulink Root— Display display nodes representing the MATLAB workspace, Simulink models, and Stateflow charts
Expand Simulink Root to display nodes representing the MATLAB workspace, Simulink models, and Stateflow charts that are in the current session.
Base Workspace— MATLAB workspace
Base Workspace represents the MATLAB workspace. The MATLAB workspace is the base workspace for Simulink models and Stateflow charts. Variables defined in this workspace are visible to all open models and charts.
Expanding a model or chart node in the Model Hierarchy pane displays nodes representing the following elements, as applicable for the models and charts you have open.
Select the Configurations node to show the model's configuration sets and configuration references in the Contents pane. For information about adding, deleting, saving, and moving configuration sets, see Manage Configuration Sets for a Model.
For information about how to use the Model Explorer to work with model workspace variables, see these topics:
|External data||Expand the External Data node to display external data sources for the model, including the base workspace (if access is enabled), and data dictionaries.|
Expand a node representing a subsystem to display underlying subsystems, if any.
Expand model blocks to show contents of referenced models.
Contents Pane— Describe the Model Explorer Contents pane
The Contents pane displays one of two tables containing information about models and charts, depending on the tab that you select:
The Contents tab displays an object property table for the node that you select in the Model Hierarchy pane.
The Search Results tab displays the search results table.
Optionally, you can also open a column view details section in the Contents pane. This graphic shows the Contents pane with the column view details section opened.
To open the column view details section, click Show Details, at the top of the Contents pane.
The Column view details section provides an interface for customizing the column view (hidden by default).
The Object property table section displays a table of model and chart object data (open by default).
In the object property table section of the Contents tab and in the Search Results tab:
Table columns correspond to object properties (for example,
The object property table displays the first two columns (the object icon and
Name property) persistently, so that these columns remain
visible regardless of how far you scroll to the right.
Table rows correspond to objects (for example, blocks, and states).
The objects and properties displayed in the Contents pane depend on:
The column view that you select in the Contents pane
The node that you select in the Model Hierarchy pane
The kind of object (for example, subsystem or chart) that you select in the Model Hierarchy pane
The View > Row Filter options that you select
The Contents of link at the top left side of the
Contents pane links to the currently selected node in the
Model Hierarchy pane. The model data displayed in the Contents
pane reflects the setting of the Current System and Below
option. In this example, Contents of links to the
vdp model, which is the currently selected node.
Views— Named set of properties
The Model Explorer uses views to specify sets of property columns to display in the Contents pane.
For each kind of node in the Model Hierarchy pane, certain properties are most relevant for the objects displayed in the Contents pane. For example, for a Simulink model node, such as a model or subsystem, some properties that are useful to display include:
BlockType (block type)
OutDataTypeStr (output data type)
OutMin (minimum value for the block output)
Generally, a column view does not contain the total set of properties for all the objects in a node. Specifying a subset of properties to display can streamline the task of exploring and editing model and chart object properties and increase the density of the data displayed in the Contents pane.
You can use a view to capture the following characteristics of the model information to show in the Model Explorer:
Properties that you want to display in the Contents pane
Layout of the Contents pane (for example, grouping by property, the order of property columns, and sorting)
You can use views in the following ways:
Use the standard views shipped with the Model Explorer
Customize the standard views
Create your own views
The first time you open the Model Explorer, the software automatically applies one of the standard views to the node you select in the Model Hierarchy pane. The Model Explorer applies a view based on the kind of node you select.
The Model Explorer assigns one of four categories of nodes in the Model Hierarchy pane. The Model Explorer initially associates a default view with each node category. The four node categories are:
|Node Category||Kinds of Hierarchy Nodes Included||Initial Associated View|
|Simulink||Models, subsystems, and root level models|
|Workspace||Base and model workspace objects|
|Stateflow||Stateflow charts and states|
|Configurations||Configurations section node|
Objects that do not fit into one of the first three categories; for example, configuration sets
The Column View field at the top of the Contents pane displays the view that the Model Explorer is currently using.
In the Contents pane, from the Column View
list, you can select a different view. If you select a different view, then the Model
Explorer associates that view with the category of the current node. For example,
suppose the selected node in the Model Hierarchy pane is a
Simulink model, and the current view is
Data Objects. If you
change the view to
Signals, then when you select another Simulink model node, the Model Explorer uses the
By default, the Model Explorer automatically applies a view, based on the category of node that you select and the last view used for that node. You can manually select a view from the Column View list that better meets your current task.
You can shift from the default mode of having the Model Explorer automatically apply views to a mode in which you must manually select a view to change views.
To enable the manual view selection mode:
Select View > Column View > Manage Views.
The View Manager dialog box opens.
In the View Manager dialog box, click the Options button and clear Change View Automatically.
In the manual view selection mode, if you switch to a different kind of node in the Model Hierarchy pane that has a different view associated with it, the Contents pane displays a yellow informational bar suggesting a view to use.
You can manage views (for example, create a new view or export a view) using the View Manager dialog box. To open the View Manager dialog box, select the Manage Views option from either:
The View > Column View menu
The options listed when you click the Options button in the column view details section
The View Manager dialog box displays a list of defined views and provides tools for you to manage views.
You can manage views in several ways, including creating, deleting, reordering, exporting, importing, and resetting views.
Tip Interface— Display/hide tips
The tip interface appears immediately above the object property table. It does not appear if you use automatic view selection. The tip interface displays a link for changing the current view to a suggested view. To choose the suggested view displayed in the tip bar, click the link. To hide the currently displayed tip, from the menu button on the right-hand side of the tip bar, select Hide This Tip.
Initially, the suggested view is the default view associated with a node. If you associate a different view with a node category, then the tip suggests the most recently selected view when you select similar nodes.
To change from manual specification of views to automatic specification, from the tip interface, select the down arrow and then the Change View Automatically menu item.
To enable the tip interface, under Options on the right side, select Manage Views, and then Options > Change View Automatically.
Property Dialog Pane— Describes the Model Explorer Dialog pane
Use the Dialog pane to view and change properties of objects that you select in the Model Hierarchy pane or in the Contents pane.
By default, the Dialog pane appears in the Model Explorer, to the right of the Contents pane. To show or hide the Dialog pane, use one of these approaches:
From the View menu, select Show Dialog Pane.
From the main toolbar, click the Dialog View button.
To edit property values using the Dialog pane:
In the Contents pane, select an object (such as a block or signal). The Dialog pane displays the properties of the object you selected.
Change a property (for example, the port number of an Outport block) in the Dialog pane.
Click Apply to accept the change, or click Revert to return to the original value.
By default, clicking outside a dialog box with unapplied changes causes the Apply Changes dialog box to appear. Click Apply to accept the changes or Ignore to revert to the original settings.
To prevent the Apply Changes dialog box from displaying:
In the dialog box, click the In the future Apply or Ignore (whichever I select) without asking check box.
If you want Simulink to apply changes without warning you, press Apply. If you want Simulink to ignore changes without warning you, press Ignore.
To restore the Apply Changes dialog box, from the Tools menu, select Prompt if dialog has unapplied changes.
When you select a numeric MATLAB variable or a
Simulink.Parameter object in a model
workspace, the Argument check box appears in the Dialog pane. This
check box configures the variable or object as a model argument. See Parameterize Instances of a Reusable Referenced Model.
daexplr opens the Model Explorer.