Using Simulink | ![]() ![]() |
Masked Subsystem Example
This simple subsystem models the equation for a line, y = mx + b
.
Ordinarily, when you double-click a Subsystem block, the Subsystem block opens, displaying its blocks in a separate window. The mx + b
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.
This example creates a custom dialog box and icon for the subsystem. One dialog box contains prompts for both the slope and the intercept. After you create the mask, double-click the Subsystem block to open the mask dialog box. The mask dialog box and icon look like this:
A user enters values for Slope and Intercept in the mask dialog box. Simulink makes these values available to all the blocks in the underlying subsystem. Masking this subsystem creates a self-contained functional unit with its own application-specific parameters, Slope and Intercept. The mask maps these mask parameters to the generic parameters of the underlying blocks. The complexity of the subsystem is encapsulated by a new interface that has the look and feel of a built-in Simulink block.
To create a mask for this subsystem, you need to
![]() | About Masks | Creating Mask Dialog Box Prompts | ![]() |