The Simulink® model editing environment consists of two main tools: the Simulink Editor and the Library Browser. You find the blocks for your model in the Library Browser and build the model by adding and connecting the blocks in the Simulink Editor.
The Simulink Editor is an intuitive tool for building models. In addition to providing standard methods for working with diagrams in a vector graphics editor, the editor provides shortcuts that help you to add and connect blocks. The Simulink Editor also gives you access to the tools you need for technical operations such as importing data, simulating your model, and analyzing model performance.
The figure shows the Simulink Editor with the example model
The Simulink Editor has menus of commands and a toolbar of shortcuts for performing frequent operations or opening tools. Tooltips appear when you hover over the toolbar buttons. Commands also appear on context menus. Context menus appear when you right-click a model element or a blank area of the editor. For example, right-click a block, and the menus display the commands relevant for working on blocks, such as clipboard and alignment operations. Some commands appear only on a context menu.
The palette along the left side of the editor provides more shortcuts. The palette shortcuts have to do with the model appearance and how you navigate the model rather than how you build and operate it. For example, the palette includes a shortcut for adding annotations and other visuals, like boxed-in areas for labeling the model. It also provides a zoom button for zooming on a particular part of the model.
The Hide/Show Explorer Bar button displays a bar that shows where you are in the model hierarchy as you navigate. The Hide/Show Model Browser button displays a hierarchical view of the model that you can use to navigate. See Explore the Model Hierarchy Using the Model Browser.
The control in the lower-right corner opens additional views of the model. One such view is the interface view, which helps you to trace model interfaces. Click the control to see these views.
When you build a model in the Simulink Editor, you use common techniques for working with graphics objects. Some of these actions include:
Selection using click, shift-click, and dragging
Resizing objects using handles and moving objects by dragging
Clipboard operations, that is, cut, copy, and paste
Undo/redo (up to 101 operations)
After you undo or redo block parameter changes, a visual cue appears that shows the current values of the affected parameters. Some parameter changes are not affected by the Undo or Redo commands. After you undo or redo changes to block parameters, use the cue to see the parameters affected.
A small subset of parameters do not support Undo. Changing these parameters clears the Undo history, whether you make the change in the Property Inspector or in the block dialog box.
You zoom and scroll the editing area using familiar methods, such as the commands on the View > Zoom menu. If you are using a supported touch display platform, you can pinch to zoom and swipe to scroll. The supported touch display devices include Microsoft® Windows® platforms with a Windows 7 certified or Windows 8 certified touch display and Macintosh platforms with an Apple Magic Trackpad.
The editor supports additional shortcuts for scrolling that are unique to Simulink. Shortcuts and the other interactive model building techniques are summarized in Keyboard and Mouse Actions for Simulink Modeling. For a tutorial, see Build and Edit a Model in the Simulink Editor.
The Simulink Editor can provide you with visual cues for some model design issues. In the model editor, highlighted blocks alert you to issues while you edit. To see a description of the issue, hover over a highlighted block and click the error or warning symbol.
Similar to the Diagnostic Viewer, if an error or warning has a predefined fix, the notification dialog box can provide you with suggested actions along with corresponding Fix buttons.
Simulink can detect block errors and warnings, such as:
Goto and From block mismatches.
Duplicate data store blocks. The value of the Duplicate data store names parameter determines if there is a visual cue, and if the cue is an error or warning.
The Errors and Warnings option is enabled by default. To turn off this option, deselect Display > Errors & Warnings.
Use the Library Browser to locate blocks and visuals (annotations) to add to your model. Navigate the libraries using the tree structure in the left pane or by double-clicking sublibraries in the right pane. Sublibraries, blocks, and text and image annotations can appear in the right pane. Hover over any item to see a description.
When you find the item you are looking for, you can drag it into your model, or you can select it and use the context menu to add it.
The Recently Used Blocks structure at the bottom of the tree contains the blocks and libraries from the supplied libraries that you used most recently.
You can search for blocks and annotations using the search controls. To use regular expressions, whole word search, or case-sensitive search, use the Search for subsystems, blocks, and annotations button arrow . For annotations, you can search for any of the text in the annotation or any part of its description.
By default, library contents appear in alphabetical order. Subsystems appear first, then blocks, and then annotations. If you prefer to view the contents of the libraries in the order set by the developer of the library, right-click the right pane and select Sort in library model order. This setting stays in effect from session to session.
To return to the alphabetical order, right-click and select Sort in alphabetical order. Depending on how the library designer set up the library, some items might not appear in alphabetical order. For example, in the Simulink library, the Additional Math & Discrete library appears as the last item regardless of the sorting option you choose.
You can create your own libraries and, optionally, have them appear in the Library Browser. See Create a Custom Library.
As you build a model, you can set parameters and properties on model elements. For example, you can set parameters and properties for blocks that affect how the block functions. You can also set properties on Stateflow® charts, signal lines, visual elements such as annotations, and on the model.
Based on your workflow and goals, set parameters and properties using:
The Property Inspector, which stays open in the editor as you work and updates based on the current selection
A dialog box that is associated with an element, such as a specific block
The Model Data Editor, which stays open and displays information about signals, states, and algorithmic block parameters (for instances, gains and filter coefficients) in a table
For blocks whose parameter value appears on the block icon, you can select the block, hover over the value, and edit the value directly. For more information, see Set Block Parameters
When you select View > Property Inspector, the interface appears in the Simulink Editor on the right. You can drag the Property Inspector from the default location and dock it in another location in the editor. You can collapse the Property Inspector interface by clicking the pushpin. The figure shows a block selected with the Property Inspector displayed.
The Property Inspector is useful when you set parameters and properties as you work. It can stay open and available for setting values for the current selection. Values take effect when you set them. This workflow simplifies your interaction with the interface.
You can alternatively open a dialog box for a selected model element using an item on the Diagram menu, such as Properties and, for blocks, Block Parameters. You can also use the context menu. Double-clicking a block generally opens a block dialog box. (Use one of the menu commands on Subsystem and Model blocks.)
The Property Inspector and dialog boxes operate on a single selection. The main difference is that the Property Inspector updates with each selection and the dialog box shows settings for only the element you opened it from. For this reason, the dialog box is useful if:
You are moving through the model hierarchy and want to see or set element parameters or properties as you navigate the model.
You want to compare the parameters or properties of similar elements.
The settings are advanced and appear only in the dialog box.
With the Model Data Editor (View > Model Data Editor), you can configure multiple signals, states, and algorithmic parameters at once. You can set only certain parameters and properties such as data types, initial values, and physical units. To work with one model element at a time, open the Property Inspector. To perform batch operations, open the Model Data Editor.
For more information about setting block properties and parameters, see Specify Signal Properties. To learn to use the Model Data Editor, see Configure Data Properties by Using the Model Data Editor.