Using Simulink | ![]() ![]() |
Controlling Icon Properties
You can control a masked block's icon properties by selecting among the choices below the Drawing commands field.
Icon frame
The icon frame is the rectangle that encloses the block. You can choose to show or hide the frame by setting the Icon 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 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.
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.
Drawing coordinates
This parameter controls the coordinate system used by the drawing commands. This parameter applies only to plot
and text
drawing commands. You can select from among these choices: Autoscale, Normalized, and Pixel.
X = [0 2 3 4 9]; Y = [4 6 3 5 8];![]()
The lower-left corner of the block frame is (0,3) and the upper-right corner is (9,8). The range of the x-axis is 9 (from 0 to 9), while the range of the y-axis is 5 (from 3 to 8).
X = [.0 .2 .3 .4 .9]; Y = [.4 .6 .3 .5 .8];![]()
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.
pos = get_param(gcb, 'Position'); width = pos(3) - pos(1); height = pos(4) - pos(2); x = [0, width]; if (m >= 0), y = [0, (m*width)]; end if (m < 0), y = [height, (height + (m*width))]; end
The drawing command that generates this icon is plot(x,y)
.
![]() | Displaying a Transfer Function on the Block Icon | The Documentation Pane | ![]() |