Using Simulink    

Creating the Block Icon

So far, we have created a customized dialog box for the mx + b subsystem. However, the Subsystem block still displays the generic Simulink subsystem icon. An appropriate icon for this masked block is a plot that indicates the slope of the line. For a slope of 3, that icon looks like this:

The block icon is defined on the Icon pane. For this block, the Icon pane looks like this.

The drawing command plots a line from (0,0) to (1,m). If the slope is negative, Simulink shifts the line up by 1 to keep it within the visible drawing area of the block.

The drawing commands have access to all the variables in the mask workspace. As you enter different values of slope, the icon updates the slope of the plotted line.

Select Normalized as the Drawing coordinates parameter, located at the bottom of the list of icon properties, to specify that the icon be drawn in a frame whose bottom left corner is (0,0) and whose top right corner is (1,1). See The Icon Pane for more information.


  Creating the Block Description and Help Text Masking a Subsystem