Change the Appearance of a Block

Change a Block Orientation

By default, a block is oriented so that its input ports are on the left, and its output ports are on the right. You can change the orientation of a block by rotating it 90 degrees around its center or by flipping it 180 degrees around its horizontal or vertical axis.

How to Rotate a Block

You can rotate a block 90 degrees by selecting one of these commands from the Diagram menu:

  • Rotate & Flip > Clockwise (or Ctrl+R)

  • Rotate & Flip > Counterclockwise

A rotation command effectively moves a block's ports from its sides to its top and bottom or from its top and bottom to its size, depending on the initial orientation of the block. The final positions of the block ports depend on the block's port rotation type.

Port Rotation Type.  After rotating a block clockwise, Simulink® may, depending on the block, reposition the block's ports to maintain a left-to-right port numbering order for ports along the top and bottom of the block and a top-to-bottom port numbering order for ports along the left and right sides of the block. A block whose ports are reordered after a clockwise rotation is said to have a default port rotation type. This policy helps to maintain the left-right and top-down block diagram orientation convention used in control system modeling applications. All nonmasked blocks and all masked blocks by default have the default rotation policy. The following figure shows the effect of using the Rotate & Flip > Clockwise command on a block with the default rotation policy.

A masked block can optionally specify that its ports not be reordered after a clockwise rotation (see Port rotation). Such a block is said to have a physical port rotation type. This policy facilitates layout of diagrams in mechanical and hydraulic systems modeling and other applications where diagrams do not have a preferred orientation. The following figure shows the effect of clockwise rotation on a block with a physical port rotation type

How to Flip a Block

Simulink provides a set of commands that allow you to flip a block 180 degrees about its horizontal or vertical axis. The commands effectively move a block's input and output ports to opposite sides of the block or reverse the ordering of the ports, depending on the block's port rotation type.

A block with the default rotation type has one flip command: Diagram > Rotate & Flip > Flip Block (Ctr+I). This command effectively moves the block's input and output ports to the side of the block opposite to the side on which they are initially located, i.e., from the left to the right side or from the top to the bottom side.

Resize a Block

To change the size of a block, select it, then drag any of its selection handles. While you hold down the mouse button, a dotted rectangle shows the new block size. When you release the mouse button, the block is resized.

For example, the following figure below shows a Signal Generator block being resized. The lower-right handle was selected and dragged to the cursor position. When the mouse button is released, the block takes its new size.

Displaying Parameters Beneath a Block

You can cause Simulink to display one or more of a block's parameters beneath the block. Specify the parameters to be displayed by using one of the following approaches:

  • Enter an attributes format string in the Attributes format string field of the block's Properties dialog box (see Set Block Properties)

  • Set the value of the block's AttributesFormatString property to the format string, using set_param

Drop Shadows

By default, blocks appear with a drop shadow.

To increase the depth of a block drop shadow:

  1. Select the block.

  2. Select Diagram > Format > Block Shadow.

For example, in this model, the Constant1 block has the Block Shadow option enabled, and the Constant2 block uses the default drop shadow.

To remove the default drop shadows for all blocks, select File > Simulink Preferences > Editor Defaults > Use classic diagram theme.

Manipulate Block Names

All block names in a model must be unique and must contain at least one character. By default, block names appear below blocks whose ports are on the sides, and to the left of blocks whose ports are on the top and bottom, as the following figure shows:

    Note   Simulink commands interprets a forward slash (/) as a block path delimiter. For example, the path vdp/Mu designates a block named Mu in the model named vdp. Therefore, avoid using forward slashes (/) in block names to avoid causing Simulink to interpret the names as paths.

Change Block Names

You can edit a block name in one of these ways:

  • To replace the block name, click the block name, select the entire name, and then enter the new name.

  • To insert characters, click between two characters to position the insertion point, then insert text.

  • To replace characters, drag the mouse to select a range of text to replace, then enter the new text.

To apply the block name edit, click the cursor anywhere else in the model, take any other action, or press Esc. If you try to change the name of a block to a name that already exists, Simulink displays an error message.

    Note   If you change the name of a library block, all links to that block become unresolved.

Change Font of Block Name

To modify the font used in a block name by selecting the block, then choosing the Font Style menu item from the Diagram > Format menu.

  1. Select the block name.

  2. Select Diagram > Format > Font Style.

    The Select Font dialog box opens.

  3. Select a font and specify other font characteristics, such as the font size.

    Note:   Changing the block name font also changes the font of any text that appears inside the block.

This procedure also changes the font of any text that appears inside the block.

Change the Location of a Block Name

To change the location of the name of a selected block, use one of these approaches:

  • Drag the block name to the opposite side of the block.

  • Choose Diagram > Rotate & Flip > Flip Block Name. This command changes the location of the block name to the opposite side of the block.

For more information about block orientation, see How to Rotate a Block.

Hide a Block Name

By default the Simulink Editor displays the names of blocks (except for a few blocks, such as the Bus Creator block). To hide the name of a selected block, clear the Diagram > Format > Show Block Name menu option.

Specify Block Color

See Specify Block Diagram Colors for information on how to set the color of a block.

Was this topic helpful?