Documentation Center

  • Trial Software
  • Product Updates

Mask a Block

This example shows how to create a block mask and define its parameters.

Create mask

  1. Open the model subsystem_examplesubsystem_example. Alternately, execute the following command in MATLAB®:

    open_system([docroot '/toolbox/simulink/ug/examples/masking..
    /subsystem_example'])

    This model contains a Subsystem block that models the equation for a line: y = mx + b.

  2. Double-click the subsystem block to open it.

    Notice that this subsystem contains the following blocks that are controlled by parameters.

    • Gain block, named Slope

    • Constant block, named Intercept

  3. Return to the top-level model, right-click the subsystem block, and select Mask > Create Mask.

    The Mask Editor appears.

Define mask parameters

Define parameters to control the underlying blocks.

  1. In the Mask Editor, click the Parameters & Dialog tab.

  2. Click the Edit parameter icon and add two rows.

  3. In the rows that appear, specify the parameters as follows.

  4. Click Apply.

Set mask parameter values

Provide values to the parameters.

  1. Double-click the mask to view the mask dialog box.

  2. Set Slope and Intercept as 5 and 2, respectively.

    To control the underlying blocks, change these parameters.

  3. Click OK.

Was this topic helpful?