Main Content

Custom Libraries

可重复使用的块和子系统库

Ablock libraryis a collection of blocks that you can use in a Simulink®模型。您可以从内置的Simulink库创建块的实例,并且可以为创建的块实例制作自定义库。金宝app

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块库. 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

要了解如何使用自定义库与其他Simulink组件化技术进行比较,请参见金宝appComponent-Based Modeling Guidelines.

When you add blocks from a custom library to a model, the block you add becomes alinked block. A linked block connects to the library block by way of alibrary link. The library block is theprototype block, and the linked block in the model is aninstanceof 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, seeLinked Blocks.

Blocks

Subsystem Group blocks to create model hierarchy

Functions

libinfo Get information about library blocks referenced by model
gcb Get path name of current block
gcbh Get handle of current block

Tools

Library Browser 在模型中查找并添加块

Objects

LibraryBrowser.LBStandalone 显示,隐藏,大小和位置金宝appLibrary Browser

Topics

Library Browser

Library Links