Main Content

Simulink.Mask.copy

Class: Simulink.Mask
Package: Simulink

Copy a mask from one block to another

Syntax

pSource = Simulink.Mask.get(srcBlockName)
pDest = Simulink.Mask.create(destBlockName)
pDest.copy(pSource)

Description

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

pDest = Simulink.Mask.create(destBlockName) creates an empty mask on the destination block specified by destBlockName.

pDest.copy(pSource) overwrites the destination mask with the source mask.

Input Arguments

srcBlockName

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

Note

The source block should be masked.

destBlockName

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

Note

The destination block should have an empty mask. Otherwise, the copied mask will overwrite the non-empty mask.

Examples

  1. Create an empty mask on the destination block using the block’s path.

    pDest = Simulink.Mask.create('myModel/Subsystem');
  2. Get source mask as an object using the source block’s path.

    pSource = Simulink.Mask.get('myModel/Abs');
  3. Make the destination mask a copy of the source mask.

    pDest.copy(pSource);