Skip to Main Content Skip to Search
Product Documentation

Adding Libraries to the Library Browser

How to Display a Library in the Library Browser

  1. Create a folder 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 folder on the MATLAB path. Two top-level libraries cannot exist in the same folder.

  2. Create or copy the top-level library and its sublibraries into the folder you created in the MATLAB path.

  3. In the folder 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).

Example of a Minimal slblocks.m File

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 slblocks.m file.

Creating 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;

Adding More Descriptive Information in 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.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS