| 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… |
|---|
How to Display a Library in the Library Browser |
Create a directory in the MATLAB path for the top-level library and its sublibraries.
You must store each top-level library that you want to appear in the Library Browser in its own directory on the MATLAB path. Two top-level libraries cannot exist in the same directory.
Create or copy the top-level library and its sublibraries into the directory you created in the MATLAB path.
In the directory for the top-level library, include a slblocks.m file.
The approach you use to create the slblocks.m file depends on your requirements for describing the library:
If a minimal slblocks.m file meets your needs, then create a new slblocks.m file, based on the example below
If you want to describe the library more fully, consider copying an existing slblocks.m file to use as a template, editing the copy to describe your library (see below).
To display a library in the Library Browser, at a minimum you must include these lines (adjusted to describe your library; comments are not required) in the slblock.m file.
% slblocks.m defines a block library function blkStruct = slblocks % Specify that the product should appear in the library browser % and be cached in its repository Browser.Library = 'mylib'; Browser.Name = 'My Library'; blkStruct.Browser = Browser; % End of slblocks.m
You can review other descriptive information you may wish to include in your slblocks.m file by examining the comments in the Simulink library slblocks.m file: matlabroot/toolbox/simulink/blocks/slblocks.m.
![]() | Creating Block Libraries | Working with Block 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 |