Main Content

Customize Block Icons

A mask is a custom interface for a block that hides the block content, making it appear as an atomic block with its own icon and parameter dialog box. The mask encapsulates the block logic, provides controlled access to the block data, and simplifies the graphical appearance of a block diagram.

A mask changes only the block interface, not the underlying block characteristics. You can provide access to one or more underlying block parameters by defining corresponding mask parameters on the mask.

Mask a Simulink® block to:

  • Display an icon on a block.

  • Provide a customized dialog box for the block.

  • Provide a dialog box that enables you to access only select parameters of the underlying blocks.

  • Provide users customized description that is specific to the masked block.

  • Initialize parameters using MATLAB® code.

To create a mask that displays an icon on the block:

  1. Right-click the block and select Mask > Create Mask.

  2. In the Mask Editor dialog box, click the Icon tab.

    Mask Editor dialog box for a Subsystem block with the Icon tab highlighted

  3. In the Mask Editor toolstrip, on the Icon tab, click Add Image.

  4. In the file browser that appears, navigate to the image you want to use and click Open.

  5. In the Mask Editor toolstrip, on the Icon tab, click Save Mask.

  6. Close the Mask Editor dialog box.

To look under the mask, click the arrow in the lower left corner of the block.

An Inport block connects to a Subsystem block, which connects to an Outport block. The Subsystem block has a mask icon that looks like a toggle switch. In the lower left corner of the Subsystem block, there is an arrow pointing down. The arrow is circled in red.

For an example on how to create a mask on which you can modify the values of block parameters, see Create a Simple Mask.

The Block Parameters dialog for a Subsystem block mask shows text boxes where you can edit the values of the parameters Slope and Intercept.

For more information about masks, see Author Block Masks.