Skip to Main Content Skip to Search
Product Documentation

Icon & Ports Pane

About the Icon & Ports Pane

Use the Icon & Ports pane to create block icons that can contain descriptive text, state equations, images, and graphics.

The Icon & Ports pane contains the controls described in this section.

Icon Drawing commands

The Icon Drawing commands text box allows you to enter code that draw the block icon. Use commands from the set of commands to display text, display one or more plots, or show a transfer function, as described in Mask Icon Drawing Commands.

You can use only these commands to draw your icon. The drawing commands execute in the order in which they appear in this field. Drawing commands have access to all variables in the mask workspace. If any drawing command cannot successfully execute, the icon displays three question marks.

You can include MATLAB comments at the end of a drawing command or on their own line, as in the following examples:

image(imread('engine.jpg'))   % Use engine icon for subsystem
% Use engine icon for subsystem
image(imread('engine.jpg')) 

The drawing commands execute when you:

Examples of drawing commands

This pane demonstrates the usage of the various icon drawing commands supported by the Simulink product. To determine the syntax of a command, select the command from the Command list. An example of the selected command is displayed at the bottom of the pane and the icon produced by the command to the right of the list.

Icon & Ports options

These controls allow you to specify the following attributes of the block icon.

Block Frame

The icon frame is the rectangle that encloses the block. You can choose to show or hide the frame by setting the Frame parameter to Visible or Invisible. The default is to make the icon frame visible. For example, this figure shows visible and invisible icon frames for an AND gate block.

Icon Transparency

The icon can be set to Opaque or Transparent, either hiding or showing what is underneath the icon. Opaque, the default, covers information the Simulink software draws, such as port labels. This figure shows opaque and transparent icons for an AND gate block. Notice the text on the transparent icon.

Icon Units

This option controls the coordinate system used by the drawing commands. It applies only to plot and text drawing commands. You can select from among these choices: Autoscale, Normalized, and Pixel.

Icon Rotation

When the block is rotated or flipped, you can choose whether to rotate or flip the icon or to have it remain fixed in its original orientation. The default is not to rotate the icon. The icon rotation is consistent with block port rotation. This figure shows the results of choosing Fixed and Rotates icon rotation when the AND gate block is rotated.

Port Rotation

The Icon & Ports > Port Rotation port option lets you specify a masked block's port rotation type. The choices are:

The default rotation option is appropriate for control systems and other modeling applications where block diagrams typically have a top-down and left-right orientation. It simplifies editing of diagrams by minimizing the need to reconnect blocks after rotations to preserve the standard orientation.

Similarly, the physical rotation option is appropriate for electronic, mechanical, hydraulic, and other modeling applications where blocks represent physical components and lines represent physical connections. The physical rotation option more closely models the behavior of the devices represented (that is, the ports rotate with the block as they would on a physical device). In addition, the option avoids introducing line crossings as the result of rotations, making diagrams easier to read.

For example, the following figure shows two diagrams representing the same transistor circuit. In one, the masked blocks representing transistors use default rotation; in the other, physical rotation.

Both diagrams avoid line crossings that make diagrams harder to read. The next figure shows the diagrams after a single clockwise rotation.

Note that the rotation introduces a line crossing in the diagram that uses default rotation but not in the diagram that uses physical rotation. Note also that there is no way to edit the diagram with default rotation to remove the line crossing. See Changing a Block's Orientation for more information.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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