Main Content

Custom Libraries

Reusable libraries of blocks and subsystems

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.

Blocks

SubsystemGroup blocks to create model hierarchy

Functions

libinfoGet information about library blocks referenced by model
gcbGet path name of current block
gcbhGet handle of current block

Tools

Library BrowserFind and add blocks to model

Objects

LibraryBrowser.LBStandaloneDisplay, hide, size, and position Simulink Library Browser

Topics

Library Browser

Library Links