Documentation Center

  • Trial Software
  • Product Updates

set

Class: Simulink.MaskParameter
Package: Simulink

Set properties of mask parameters

Syntax

Simulink.MaskParameter.set(Name,Value)

Description

Simulink.MaskParameter.set(Name,Value) sets the properties of a mask parameter.

Input Arguments

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'

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

Default: edit

'TypeOptions'

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

Default: empty

'Name'

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

Default: empty

'Prompt'

Text that identifies the parameter on the Mask Parameters dialog.

Default: empty

'Value'

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

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

'Evaluate'

Option to specify whether parameter must be evaluated.

Default: 'on'

'Tunable'

Option to specify whether parameter is tunable.

Default: 'on'

'Enabled'

Option to specify whether user can set parameter value.

Default: 'on'

'Visible'

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

Default: 'on'

'Callback'

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

Default: empty

'TabName'

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

Default: empty

Examples

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

    p = Simulink.Mask.get('myModel/Subsystem');
  2. Get a mask parameter.

    a = p.Parameters(1);
  3. Edit mask parameter so it is of type popup, cannot be evaluated, and appears on a tab named Properties in the Mask Parameters dialog.

    a.set('Type','popup','TypeOptions',{'Red' 'Blue' 'Green'},...
    'Evaluate','off','TabName','Properties');

See Also

|

Was this topic helpful?