addParameter
Class: Simulink.Mask
Package: Simulink
Add a parameter to a mask
Syntax
p = Simulink.Mask.get(blockName)
p.addParameter(Name,Value)
Description
gets
the mask on the block specified by p
= Simulink.Mask.get(blockName)blockName
as
a mask object.
appends a parameter to the mask. If you do not specify name–value pairs as arguments
with this command, Simulink® generates name for
the mask parameter with control type set to p
.addParameter(Name,Value
)edit
.
Input Arguments
Examples
Add Popup Parameter
Step 1: Get mask as an object using a masked block’s path.
new_system('paramexample'); add_block('built-in/subsystem','paramexample/subsystem'); save_system; open_system('paramexample'); p= Simulink.Mask.create(gcb); p= Simulink.Mask.get(gcb);
Step 2: Add a parameter to the mask without specifying name–value pairs for parameter attributes.
p.addParameter;
Step 3: Add a mask parameter of type popup that cannot be evaluated.
p.addParameter('Type','popup','TypeOptions',{'Red' 'Blue' 'Green'},'Evaluate','off'); save_system;