Main Content

Create a Block Mask Icon

You can create block icons on mask using various mask drawing commands. This model contains a collection of subsystem blocks, each showing a particular mask drawing command in use. To create a mask icon on a block, you must create a mask and add the icon drawing command to the mask in the mask editor. To create a mask:

  1. Select a Subsystem block . For example, the Graph as Icon block.

  2. On the Subsystem Block tab, in the Mask group, click Create Mask/Edit Mask.

  3. In the Mask Editor dialog box, click the Icon & Ports tab.

  4. Enter the command in the Icon drawing commands pane on the right. You can set the Run Initialization value to On, Off or Analyze based on the dependency on mask workspace.

Plotted function as Icon

This command let you plot a graph and set it as the mask icon. Select the subsystem Graph as Icon. In the Mask Editor > Icon and Ports tab, enter plot([10 20 30 40], [10 20 10 15]). Run Initialization can be set to Off as there is no mask workspace dependency.

Transfer Function as Icon

This command helps to set a Transfer function as the mask icon. Select the subsystem Transfer Function as Icon. In the Mask Editor > Icon and Ports tab, enter droots([-1], [-4 -5], 4). Run Initialization can be set to Off as there is no mask workspace dependency.

Color patch as Icon

This command lets you to set a color patch as mask icon. Select the subsystem Color patch as Icon. In the Mask Editor > Icon and Ports tab, enter patch([0 10 20 30 30 0], [10 30 20 25 10 10],[1 0 0]). Run Initialization can be set to Off as there is no mask workspace dependency.

Image as Icon

This command lets you to set a color patch as mask icon. Select the subsystem Image as Icon. In the Mask Editor > Icon and Ports tab, enter image('maskimage.png','center'). Run Initialization is set to On. Make sure the image is available in the current folder in MATLAB.

Contained block icon as Icon

This command lets you promote the icon of a block contained in a subsystem to the subsystem mask. Select the subsystem Promoted block Icon . In the Mask Editor > Icon and Ports tab, enter block_icon(Assertion).

open_system('mask_icon_drawing_example');