Considerations for Masking Model Blocks

Referenced Model Name

You can use a mask parameter to specify the name of a model referenced by

  • a masked Model block, or

  • a Model block in a masked subsystem

In these cases, the mask parameter should receive the name of the reference model literally, without being evaluated, because Simulink® updates model reference targets before mask parameters.

Use one of the following approaches to obtain the literal name of the referenced model:

  • Restricted model names: In the Parameters & Dialog pane of the Mask Editor, select the parameter that stores the referenced model name. Set its Type to popup and clear the check box for Evaluate.

    With this approach, users can only select a model name from a drop-down list in the mask dialog box. Further, since the Evaluate option is cleared, the name is provided literally and not numerically evaluated.

  • Unrestricted model names: In the Parameters & Dialog pane of the Mask Editor, select the parameter that stores the referenced model name. Set its Type to edit and clear the check box for Evaluate.

    With this approach, users can type the model name in the mask dialog box. However, since the Evaluate option is cleared, the name is provided literally and not numerically evaluated.

See Parameters & Dialog Pane for more information about Pop-Up and Edit controls.

Variable Workspace

When you mask a model block that references another model, the referenced model cannot access the mask workspace of the model block.

Therefore, variables used by the referenced model must resolve either to workspaces defined by the referenced model or to the base workspace.

Was this topic helpful?