| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
About Masks and User-Defined Libraries Masking a Block for Inclusion in a User Library |
You can mask a block that will be included in a user library or already resides in a user library, or you can mask an instance of a user library block that you have copied into a model. For example, a user library block might provide the capabilities that a model needs, but its native interface might be inappropriate or unhelpful in the context of the particular model. Masking the block could give it a more appropriate user interface.
You can create a custom block by encapsulating a block diagram that defines the block's behavior in a masked subsystem and then placing the masked subsystem in a library. You can also apply a mask to any other type of block that supports masking, then include the block in a library.
Masking a block that will later be included in a library requires no special provisions. Create the block and its mask as described in this chapter, and include the block in the library as described in Creating Block Libraries.
Creating or changing a library block mask immediately changes the block interface in all models that access the block using a library reference, but has no effect on instances of the block that already exist as separate copies. To apply or change a library block mask:
Open the library that contains the block.
Choose Edit > Unlock Library.
You can now apply, change, or remove a mask as you could if the block did not reside in a library. In addition, you can specify non-default values for block mask parameters. When the block is referenced within or copied into a model, the specified default values appear on the block's Mask Parameters dialog box. By default, edit fields have a value of zero, check boxes are cleared, and drop-down lists select the first item in the list. To change the default for any field:
Fill in the desired default values or change check box or drop-down list settings
Click Apply or OK to save the changed values into the library block mask.
Be sure to save the library after changing the mask of any block that it contains. Saving the library will automatically relock it. Complete information about user libraries, appears in Working with Block Libraries. Additional information relating to masked library blocks appears in Creating Block Libraries.
A block that was copied from a user library, as distinct from a block accessed by using a library reference, has no special status with respect to masking. You can add a mask to the copied block, or change or remove any mask that it already has.
![]() | Masking a Model Block | Operating on Existing Masks | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |