Contenuto principale

set

Class: Simulink.MaskParameter
Namespace: Simulink

Set properties of mask parameters

Description

maskobj.Parameters.set(Name=Value) sets the properties of a mask parameter.

example

Name-Value Arguments

expand all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Type of parameter, specified as string scalar or character vector.

Data Types: char | string

The options that are displayed within a popup or combobox or listbox parameter, specified as a cell array.

Data Types: cell

The name of the mask parameter, specified as a character vector. This name is assigned to the mask workspace variable created for this parameter. If you do not specify a value for Name, Simulink® assigns the name ParameterN, where N is the index of the parameter in the array stored in the Parameters property of the mask object.

Data Types: char | string

Display name for the mask parameter, specified as a string scalar or character vector. This name appears as the label associated with the parameter on the mask dialog box.

Data Types: char | string

The default value of the mask parameter in the Mask Parameters dialog specified as string scalar or character vector. The value you specify depends on the Type of the parameter.

Data Types: char | string

Option to evaluate mask parameter, specified as "on" or "off".

Data Types: char | string

Option to change the mask parameter during simulation, specified as one of these values:

  • "on" — You can change the mask parameter value during simulation. Each time you make a change the model is compiled.

  • "off" — You cannot change mask parameter values during simulation in this mode.

  • "run-to-run" — In Fast Restart mode, the value of the parameter can be changed between runs. The model is not recompiled to reflect the value in simulation results.

Data Types: char | string

Option to save the mask parameter value in the model file, specified as "on" or "off".

Data Types: char | string

Option to hide the mask parameter in the mask dialog box, specified as "on" or "off".

Data Types: char | string

Option to edit the mask parameter in the mask dialog box, specified as"on" or "off".

Data Types: char | string

Option to enable the mask parameter in the mask dialog box, specified as "on" or "off".

Data Types: char | string

Option to show the mask parameter in the mask dialog box, specified as a"on" or "off".

Data Types: char | string

Option to enable tooltips for the mask parameter, specified as "on" or "off".

Data Types: char | string

Callback code for the mask parameter, specified as a string scalar or character vector. The callback code executes when a user changes the parameter value in the mask dialog box.

Data Types: char | string

Alternative name for the mask parameter is specified as a string scalar or character vector.

Data Types: char | string

Layout options for the parameter in the mask dialog box. Use this parameter to specify the location of the parameter, such as the row and prompt placement in the mask dialog box. Additionally, you can also control the horizontal stretch or shrink of the mask parameter.

Example: parameters.DialogControl.Row ="new"

Examples

expand all

Load the model and create a mask object.

open_system("slexMaskingBasic.slx");
maskObj = Simulink.Mask.get("slexMaskingBasic/mx + b");

Create a mask popup parameter.

maskObj.addParameter(Name='Speed',Type='popup',TypeOptions={'Red' 'Blue' 'Green'}');

Get mask parameter.

parameters = maskObj.getParameter('Speed');

Edit the mask parameter to set the property Evaluate to off.

parameters.set('Type','popup','TypeOptions',{'Red' 'Blue' 'Green'},'Evaluate','off')

Version History

Introduced in R2006a