Class: Simulink.Mask
Package: Simulink

Add a parameter to a mask


p = Simulink.Mask.get(blockName)


p = Simulink.Mask.get(blockName) gets the mask on the block specified by blockName as a mask object.

p.addParameter(Name,Value) appends a parameter to the mask. If you do not specify name–value pairs as arguments with this command, Simulink® creates an unnamed mask parameter with control type set to edit.

Input Arguments


The handle to the block or the path to the block inside the model.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.


Type of control that is used to specify the value of this parameter.

Default: edit


The options that are displayed within a popup control or in a promoted parameter. This field is a cell array.

Default: empty


The name of the mask parameter. This name is assigned to the mask workspace variable created for this parameter.

Default: empty


Text that identifies the parameter on the Mask Parameters dialog box.

Default: empty


The default value of the mask parameter in the Mask Parameters dialog box.

Default: Type specific; depends on the Type of the parameter


Option to specify whether parameter must be evaluated.

Default: 'on'


Option to specify whether parameter is tunable.

Default: 'on'


Option to specify whether user can set parameter value.

Default: 'on'


Option to set whether mask parameter is hidden or visible to the user.

Default: 'on'


Container for MATLAB® code that executes when user makes a change in the Mask Parameters dialog box and clicks Apply.

Default: empty


The name of the tab in the Mask Parameters dialog box where the parameter appears.

Default: empty


Option to specifies a container for the child dialog control. The permitted values are 'panel', 'group', and 'tab'.


  1. Get mask as an object using a masked block's path.

    p = Simulink.Mask.get('myModel/Subsystem');
  2. Add a parameter to the mask without specifying name–value pairs for parameter attributes.

  3. Add a mask parameter of type popup that cannot be evaluated and appears on a tab named Properties in the Mask Parameters dialog box.

    {'Red' 'Blue' 'Green'},'Evaluate','off','TabName','Properties');
Was this topic helpful?