Main Content

set

Class: Simulink.Mask
Package: Simulink

Set the properties of an existing mask

Syntax

p = Simulink.Mask.get(blockName)
p.set(Name,Value)

Description

p = Simulink.Mask.get(blockName) gets the mask on the block specified by blockName as a mask object.

p.set(Name,Value) sets mask properties that you specify using name–value pairs as arguments.

Input Arguments

blockName

The handle to the block or the path to the block inside the model.

Name-Value 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 quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Type

Text used as title for mask documentation that user sees on clicking Help in the Mask Parameters dialog box.

Default: empty

Description

Text used as summary for mask documentation that user sees on clicking Help in the Mask Parameters dialog box.

Default: empty

Help

Text used as body text for mask documentation that user sees on clicking Help in the Mask Parameters dialog box.

Default: empty

Initialization

MATLAB® code that initializes the mask.

Default: empty

SelfModifiable

Option to set whether the mask can modify itself during simulation.

Default: 'off'

Display

MATLAB code that draws the mask icon.

Default: empty

IconFrame

Option to specify whether the mask icon appears inside a visible block frame.

Default: 'on'

MaskIconOpaque

Option to set the mask icon as opaque or transparent.

Default: 'opaque'

RunInitForIconRedraw

Option to specify whether Simulink® should run mask initialization before executing the mask icon commands.

Default: 'off'

IconRotate

Option to specify icon rotation.

Default: 'none'

PortRotate

Option to specify port rotation.

Default: 'default'

IconUnits

Option to specify whether mask icon is autoscaled, normalized, or scaled in pixels.

Default: 'autoscale'

Examples

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

    p = Simulink.Mask.get('myModel/Subsystem');
  2. Modify the mask so that its mask icon is transparent and its documentation summarizes what it does.

    p.set('IconOpaque','off','Type','Random number generator','Description',...
    'This block generates random numbers.');