Using Simulink    

The Icon Pane

The Mask Editor's Icon pane enables you to create icons that can contain descriptive text, state equations, images, and graphics.

The Icon pane contains the following controls.

Drawing commands

This field allows you to enter commands that draw the block's icon. Simulink provides a set of commands that can display text, one or more plots, or show a transfer function (see Mask Icon Drawing Commands) in the online Simulink reference). You must use these commands to draw your icon. Simulink executes the drawing commands in the order in which they appear in this field. Drawing commands have access to all variables in the mask workspace.

This example demonstrates how to create an improved icon for the mx + b sample masked subsystem discussed earlier in this chapter.

These initialization commands define the data that enables the drawing command to produce an accurate icon regardless of the shape of the block. The drawing command that generates this icon is plot(x,y).

Examples of drawing commands

This panel illustrates the usage of the various icon drawing commands supported by Simulink. To determine the syntax of a command, select the command from the Command list. Simulink displays an example of the selected command at the bottom of the panel and the icon produced by the command to the right of the list.

Icon options

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

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.

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

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.


  The Mask Editor The Parameters Pane