| Contents | Index |
You can directly mask built-in blocks with the Mask Editor to provide custom icons and dialog boxes. In the Mask Editor, you can choose to promote any underlying parameter of any block to the mask. For subsystems, you can choose to promote parameters from any child blocks. For a subsystem block, you can associate a single mask parameter with multiple promoted parameters if they are of the same type. Changing the value of the mask parameter also sets the value of the associated promoted parameters.
You can use masking in the following use cases:
You can directly mask a built-in block to simplify the interface and add custom parameters.
You can promote multiple parameters from child blocks to a single mask parameter for a subsystem block.
You can promote all parameters for a directly masked built-in block, and then choose a subset of the parameters to keep in the mask.
Right-click your block or subsystem and select Create Mask.
In the Mask Editor, select the Parameters pane.
To choose one or more parameters for promotion:
Create a new mask parameter by clicking Add Parameter.
Click the Promote button, just
beneath the Add Parameter button.
![]()

The Promoted parameter selector dialog box opens.

Choose underlying block parameters to promote to the currently selected mask parameter:
Select a parameter in the Promotable parameters table and click the right-arrow button to add to the Promoted parameters list.
If you are masking a subsystem, you can use the Child blocks list or the Search box to find the underlying block parameters that you want to promote.
(Optional) If you are masking a subsystem, you can associate multiple promoted parameters with the currently selected mask parameter, provided they are of the same type. For example, you can promote multiple Gain parameters in a subsystem to a single prompt on your mask.
Click OK to return to the Mask Editor.
Observe that the Type field is now disabled because you have promoted a parameter to this mask parameter. Type is always disabled. Variable is also disabled if you are directly masking a built-in block and not a subsystem.
The Relative block path table shows you the location of the underlying original block (where "." means "self"). You can click the link under Relative block path to open the underlying block.

Edit the prompt names for the mask, if desired. You cannot edit the variable names of built-in block parameters. See Rules for Promoting Parameters.
Repeat step 3 to add mask parameters and add or edit additional promoted parameters.
Click OK to finish editing the mask.
Now whenever you set a mask parameter, you also set the value of the underlying promoted parameters.
You can directly mask a built-in block to simplify the interface and add custom parameters. The following example demonstrates how to mask the Gain block and promote only the Gain parameter to the mask, while hiding the other options and adding custom parameters.
Right-click your Gain block and select Create Mask.
In the Mask Editor, select the Parameters pane.
Create a new mask parameter by clicking Add Parameter.
Click the Promote button, just
beneath the Add Parameter button.
.
The Promoted parameter selector dialog box opens.
Select the Gain parameter in the Promotable parameters table and click the right-arrow button to add to the Promoted parameters list.

Click OK to return to the Mask Editor.
Observe that fields such as Variable and Type are now disabled because you have promoted a built-in parameter to this mask parameter, and the Relative block path table shows you the location of the underlying original block (where "./" means "self"). You can click the link in the Relative block path table to open the underlying Gain block.
(Optional) Add custom mask parameters by clicking Add Parameter. The example shown next adds an edit box for company notes.

Click OK to finish creating the mask.
Double-click the Gain block. The new mask opens, showing only the promoted Gain parameter and custom parameter.

Look under the mask to see the underlying Gain block dialog box. You can see that the Gain parameter is now disabled because you have promoted it to the mask.

You can promote multiple parameters from child blocks to a single mask parameter for a subsystem block. This enables you to use a simplified single setting in the mask to set multiple child block parameters (of the same type) in the subsystem.
The following example demonstrates this capability. It recreates the functions of the Ramp block by using other blocks in a subsystem, and then masking the subsystem to create a simplified custom interface.
The Mask Editor contains a selection of promoted parameters from underlying blocks within the subsystem. The selected parameter has three underlying parameters of the same type promoted to the same mask parameter.

The Promoted parameter selector dialog shown next demonstrates how to specify this setup. Three parameters of the same type, from different child blocks, are added to the Promoted parameters list to promote to the currently selected mask parameter.

The mask shows the four parameters specified in the Mask Editor.

When you select the Interpret vector parameters as 1-D check box on the mask, you also set the underlying promoted parameters in the three child blocks.
General rules:
You cannot mask blocks that already have masks. For example, some Simulink blocks like the Ramp and Chirp Signal in the Sources library cannot be masked.
Some parameters with certain attributes cannot be promoted and if you try you see an error message.
After you promote a parameter to the mask:
The parameter is disabled on the block dialog box. If you try to directly edit promoted parameters, either in the dialog or at the command line, you see an error message.
You cannot promote the same parameter again to a different parameter.
The mask parameter inherits the Evaluate property from the parameter promoted to it, and you cannot change it. Any mismatch between the Evaluate property of the mask parameter and the promoted parameter results in an error message.
When promoting parameters from a directly masked built-in block:
The mask parameter must have the same variable name as that of the parameter promoted to it. You cannot change the promoted mask parameter variable names because they are strictly inherited from the underlying built-in block parameter.
The mask tries to retain the dynamic dialog behavior, if any, of the promoted parameter. You can specify your own dynamic dialog behavior of the mask parameter. If you do, the mask first executes the dynamic dialog callback of the promoted parameter, followed by the user-specified dynamic dialog callback of the mask parameter.
You cannot promote multiple parameters to a single mask parameter.
Promoting parameters from child blocks within subsystems:
You can associate multiple parameters provided they are of the same type. If the parameter is of type popup or DataType then the options must also be the same for them to be promoted together. The Evaluate property among the parameters to be promoted together must be similar.
If a child block is masked, you cannot promote the underlying block dialog parameters.
For child blocks, you cannot view or promote parameters from inside a masked block.
For child blocks, you cannot view or promote parameters from inside a linked block.
Links created from masked blocks:
The underneath block dialog opens completely disabled for the links of masked blocks. You can edit values only from the mask dialog.
If the mask author decides not to promote a parameter, its value in the linked blocks is tied to the library value for that parameter as specified in the library.
![]() | Masks on Blocks in User Libraries | Operating on Existing Masks | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |