set
Class: Simulink.Mask
Namespace: Simulink
Set properties of an existing mask
Syntax
Description
maskObj.set(
sets
mask properties that you specify using name–value pairs as arguments.Name,Value
)
To get the mask object for the mask on a block named BlockName
, use
this command.
maskObj = Simulink.Mask.get("BlockName"
)
Name-Value Arguments
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.
Mask type of the associated block is specified as a character vector or string.
Data Types: char
| string
Description of the block, specified as a character vector or string.
Data Types: char
| string
Help text for the masked block, specified as a character vector or string.
Data Types: char
| string
Initialization commands for the masked block, specified as a character vector or string.
Data Types: char
| string
Option to allow the block to modify its contents, specified as a logical.
Data Types: logical
MATLAB code for the block icon, specified as a character vector or string.
Data Types: char
| string
Visibility of the block frame, specified as a logical value.
Data Types: logical
Option to make the icon opaque, specified as a logical.
Opaque: Make the icon opaque.
Transparent: Make the icon transparent.
Data Types: string
| char
Option to run mask initialization commands before executing the mask icon commands, specified as enumerated data type.
Data Types: enum
Option to rotate icon along with block, specified as enumerated data type.
Data Types: enum
Port rotation type, specified as enumerated data type. Set this property to
default
to reorder ports after a clockwise rotation to maintain a
left-to-right port numbering order for ports along the top and bottom of the block and
a top-to-bottom port numbering order for ports along the left and right sides of the
block. Set this property to physical
to rotate ports with the block
without reordering them after a clockwise rotation.
Data Types: enum
Units for drawing commands, specified as enumerated type.
autoscale
scales the icon to fit the block frame.
normalized
draws the icon within a block frame whose bottom-left
corner is (0,0) and whose top-right corner is (1,1). Only X and Y values from 0
through 1 appear. When the block is resized, the icon is also resized.
pixels
draws the icon with X and Y values expressed in pixels.
The icon is not automatically resized when the block is resized.
Data Types: enum
Use this option to save the callback file along with the model, if you have mask initialization code and callback code in a separate MAT file, specified as a logical value.
Data Types: logical
Name of the callback file containing the mask initialization code and callback code, specified as a character vector or string.
Data Types: char
| string
Mask parameter properties, specified as a Simulink.MaskParameter
object.
Data Types: object
Port identifier properties, specified as a
Simulink.Mask.PortIdentifiers
object.
Data Types: object
Option to add or remove parameter constraint rule, specified as a
Simulink.Mask.Constraints
object.
Data Types: object
Constraints between parameters, specified as
Simulink.Mask.CrossParameterConstraints
object.
Data Types: object
Option to add or remove port constraints, specified as a
Simulink.Mask.PortConstraint
object.
Data Types: object
Option to add or remove constraints on ports of the masked block, specified as a
Simulink.Mask.CrossPortConstraint
object.
Data Types: object
Examples
Get mask as an object using a masked block’s path.
maskObj = Simulink.Mask.get('setparameter/Subsystem');
Modify the mask so that its mask icon is transparent and its documentation summarizes what it does.
maskObj.set('IconOpaque','off','Type','Random number generator',... 'Description','This block generates random numbers.');
Version History
Introduced in R2014a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)