Using Simulink    

Creating Self-Modifying Masked Blocks

A masked block can modify itself based on user input. In particular, a masked block can change the contents of its underlying system block and set the parameters of those blocks based on user input. For example, you can create a block that adds or deletes input and output ports depending on some user setting.

When creating a self-modifying masked block, you must set its MaskSelfModifiable parameter to 'on'. Otherwise, Simulink generates an error when the block tries to modify itself, that is, when any code in the masked block's workspace tries to add or delete blocks from the underlying system block or modify the parameters of any blocks in the underlying system block.

To set the MaskSelfModifiable parameter, select the self-modifying block and enter the following command

at the MATLAB prompt. Then, save the block.


 The Mask Help Text Field Creating Dynamic Dialogs for Masked Blocks