| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
The next figure shows a Subsystem block that models the equation for a line, y = mx + b. The techniques for creating such a subsystem appear in Creating Subsystems. The subsystem is not atomic, so the Subsystem block is just a graphical abbreviation for the underlying blocks:

Double-clicking an unmasked Subsystem block opens a separate window that displays the contents of the subsystem, as shown in the above figure. This subsystem contains a Gain block, named Slope, whose Gain parameter is specified as m, and a Constant block, named Intercept, whose Constant value parameter is specified as b. These parameters represent the slope and intercept of a line. To examine this model, click subsystem_example or execute:
run([docroot '/toolbox/simulink/ug/examples/masking/subsystem_example.mdl'])
The organization of this model has several disadvantages:
Although the block gives some indication of its purpose by showing the calculation that it performs, the icon adds no specific information.
Only the values of the Gain and Constant value parameters are relevant outside the subsystem, but editing the subsystem displays its entire contents.
The names of the block parameters within the subsystem relate to Simulink architecture rather than to the purpose of the subsystem.
These problems can be overcome by applying a mask to the Subsystem block. This mask can:
Provide an icon that reflects the subsystem's purpose
Show only the parameters that are used outside the subsystem
Give those parameters names that relate to the subsystem's purpose
The next figure shows the above model with a mask applied to the Subsystem block. To examine this model, click masking_example or execute:
run([docroot '/toolbox/simulink/ug/examples/masking/masking_example.mdl'])

Masking the subsystem has created a self-contained functional unit. A customized mask icon replaces the default Subsystem block icon. Double-clicking the mask icon opens a customized Mask Parameters dialog box, which replaces the Subsystem block dialog box. The Mask Parameters dialog box shows two parameters: Slope, which provides the value of m in the subsystem Gain block, and Intercept, which provides the value of b in the subsystem Constant block.
These parameters are the only constructs within the subsystem that are of interest outside the subsystem, so the mask has been designed to hide everything else. The mask parameters are currently set to 5 and 2, respectively. These values are not part of the mask itself, but were entered just as if they were the values of ordinary block parameters. The parameter values are available to all the blocks in the underlying subsystem. The mask icon displays a line that reflects the current value of the Slope parameter.
![]() | Why Use a Mask? | Roadmap for Masking Blocks | ![]() |

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