A block library is a collection of blocks that you can use in a Simulink® model. You can create instances of blocks from built-in Simulink libraries, and you can make custom libraries for instances of blocks that you create.
You can access the built-in libraries from the Simulink Library Browser. However, you cannot modify these libraries. For more information on built-in libraries, see Block Libraries. To enable others to create custom blocks, you can create your own block library and add it to the Library Browser.
Creating your own libraries is a useful componentization technique for:
Providing frequently used, and seldom changed, modeling utilities
Reusing components in a model or in multiple models
To learn how using custom libraries compares to other Simulink componentization techniques, see Component-Based Modeling Guidelines.
When you add blocks from a custom library to a model, the block you add becomes a linked block. A linked block connects to the library block by way of a library link. The library block is the prototype block, and the linked block in the model is an instance of the library block.
The linked block looks and acts like the library block. However, if you change the library block, you must update the link on the instances. Changing an instance can also require additional steps. To learn how linked blocks work, see Linked Blocks.
Subsystem | Group blocks to create model hierarchy |
Unresolved Link | Indicate unresolved reference to library block |
LibraryBrowser.LibraryBrowser2 | Display, hide, size, and position Simulink Library Browser |
Add blocks and annotations to a custom library and define the library structure.
Component-Based Modeling Guidelines
Consider componentization for large models and multiuser development teams.
Add Libraries to the Library Browser
Create a library, add it to the library browser, and customize library order.
Explore linked blocks, parameterized links, and self-modifiable linked subsystems.
Identify link status using the link badge.
Disable or Break Links to Library Blocks
Disable library links.
Lock Links to Blocks in a Library
Prevent unintentional disabling of library links.
Restore library links and link inconsistency.
A parameterized link is created when you change the parameter values of the child blocks of a masked subsystem linked block.
Control Linked Block Programmatically
Use MATLAB® commands to manage linked blocks.
Handle unresolved library links.
Parameterized Links and Self-Modifiable Linked Subsystems
Modify a parameter value or structure of linked Subsystem block.
Create a Self-Modifiable Library Block
Example showing a self-modifiable linked subsystem.
Map old and new library blocks using forwarding tables.