主要内容

Simulink.dialog.ParameterTree Class

Namespace: Simulink.dialog

Display mask parameters in nested structure on mask dialog box

Since R2026a

Description

Use parameter tree container to organize mask parameters in a tree like structure. The parameter tree container supports edit, check box, popup, and combo box parameters, and group box containers. Use group boxes within parameter tree container to organize these parameters hierarchically.

The Simulink.dialog.ParameterTree class is a handle class.

Properties

expand all

Text that is displayed in the parameter tree container element on the Mask dialog box, specified as a character vector or string.

Data Types: char | string

Option to set whether the dialog control is placed in the new row or the same row, specified as character vector or string.

Data Types: char | string

Option to edit the parameter tree container on the mask dialog box, specified as 'on' or 'off'.

  • 'on' — You can click the parameter tree container on a mask dialog box.

  • 'off' — You cannot click the parameter tree container on a mask dialog box.

Data Types: char | string

Option to display the parameter tree container on the mask dialog box, specified as 'on' or 'off'.

Data Types: char | string

Option to justify mask parameters within parameter tree container, specified as 'on' or 'off'.

  • 'on' — Justify mask parameters within parameter tree container based on the longest parameter prompt.

  • 'off' — Do not justify mask parameters.

Data Types: logical

Child dialog controls of the parameter tree container, specified as Simulink.dialog.parameter.Control object.

Informative message that appears when you point to an instance of the parameter tree container, specified as a string or character vector.

Data Types: string | char

Methods

expand all

Examples

collapse all

Load the model

model = "slexMaskingBasic.slx";
load_system(model);

Get the mask object of the block mx + b and add parameter tree container to it.

maskObj = Simulink.Mask.get("slexMaskingBasic/mx + b");
maskObj.addDialogControl(Name="Resistor",Type="parametertree",Prompt="Resistor");

Create a group box inside parameter tree container Resistor.

maskObj.addDialogControl(Name="Parameters",Type="group",Prompt="Parameters",Container="Resistor");
maskObj.addDialogControl(Name="NominalValues",Type="group",Prompt="Nominal Values",Container="Resistor");
maskObj.addDialogControl(Name="InitialTargets",Type="group",Prompt="Initial Targets",Container="NominalValues");

Add mask parameters inside group boxes in a nested structure. Specify the container to which the mask parameter belong to.

maskObj.addParameter(Name="Resistance",Type="edit",Prompt="Resistance",Container="Parameters");
maskObj.addParameter(Name="Configurability",Type="popup",Prompt="Configurability",TypeOptions={"Compile Time", "Run Time"},Container="Parameters");
maskObj.addParameter(Name="Current",Type="checkbox",Prompt="Current",Container="InitialTargets");
maskObj.addParameter(Name="Voltage",Type="checkbox",Prompt="Voltage",Container="NominalValues");

Version History

Introduced in R2026a