Configure Model Element Names and Labels
You can configure model element names and labels by changing the text they display, hiding them, and changing their location on a block or signal line.
Blocks have names, and signal lines have labels.
In Bus Element and Out Bus Element blocks have both a name and a label. Depending on what type of element the block is handling, the label describes a bus, signal, or message.
Label Signal Lines
To label a signal line, double-click the signal line, then type the label. For the label naming requirements, see Signal Names and Labels.
To change an existing signal line label, double-click the label, then type the new label.
Move Signal Line Labels
By default, signal line labels appear below horizontal signal lines and to the left of vertical signal lines. To change the location of a block name, drag the signal line label to either side of the signal line.
Change Block Names
The Simulink® Editor names blocks when you add them to a model. The first occurrence of the block is the library block name, for example, Gain. The next occurrence is the block name with a number appended. Each new block increments the number, for example, Gain1, Gain2, and so on. These names are called automatic names.
Copying and pasting blocks whose names follow numeric order (Gain1, Gain2, and so on) creates names that follow standard sorting order conventions for ASCII characters.
To change the block name:
Select the block.
Double-click the block name.
Type the new name.
Hide or Display Block Names
You can edit block names when they are displayed.
By default, the automatic names that the Simulink Editor assigns to new blocks you add to the model are hidden. Non-automatic
names are displayed. For example, if you add your second gain block to a model, the
Gain2, is hidden by default. If you rename the block, the
new name is displayed by default.
To temporarily display a block name, pause on the block.
Pausing on a block temporarily displays the block name irrespective of all other settings.
To persistently display or hide a block name, click the block. Pause on the ellipsis that appears. In the action bar that expands, click Show Block Name or Hide Block Name .
To persistently set the visibility of all blocks with automatic names, select one or multiple blocks. In the Simulink Toolstrip, on the Format tab, in the Block Layout section, click the button labeled Auto Name, Name On, or Name Off depending on its current setting.
To display block names of all blocks with automatic names, in the Model Settings section, clear Hide Automatic Block Names.
To hide display block names of all blocks with automatic names, in the Model Settings section, select Hide Automatic Block Names.
To persistently set the visibility of a selected set of blocks, select one of the options above the Model Settings section instead.
Name On displays automatic and non-automatic names irrespective of the Hide Automatic Block Names setting.
Name Off hides automatic and non-automatic names irrespective of the Hide Automatic Block Names setting.
Auto Name returns automatic names to the default state.
To display and hide block names programmatically, use the
set_param command with the
'HideAutomaticNames' option for
models and the
options for blocks. For more information on these parameters, see Common Block Properties. The
table shows how these parameters interact.
|Any||Any||Name is hidden|
|Name is hidden|
|Any||Name is shown|
|Name is shown|
Move Block Names
By default, block names appear below blocks whose ports are on the sides and to the left on blocks whose ports are on the top and bottom. To change the location of a block name, do one of these:
Drag the block name to any side of the block.
Select the block and, on the Format tab, click Flip Name.