| Using Simulink | ![]() |
The Library Browser lets you quickly locate and copy library blocks into a model. To display the Library Browser, click the Library Browser button in the toolbar of the MATLAB desktop or Simulink model window or enter simulink at the MATLAB command line.
The Library Browser contains three panes.
The tree pane displays all the block libraries installed on your system. The contents pane displays the blocks that reside in the library currently selected in the tree pane. The documentation pane displays documentation for the block selected in the contents pane.
You can locate blocks either by navigating the Library Browser's library tree or by using the Library Browser's search facility.
Navigating the Library Tree
The library tree displays a list of all the block libraries installed on the system. You can view or hide the contents of libraries by expanding or collapsing the tree using the mouse or keyboard. To expand/collapse the tree, click the +/- buttons next to library entries or select an entry and press the +/- or right/left arrow key on your keyboard. Use the up/down arrow keys to move up or down the tree.
Searching Libraries
To find a particular block, enter the block's name in the edit field next to the Library Browser's Find button, then click the Find button.
Opening a Library
To open a library, right-click the library's entry in the browser. Simulink displays an Open Library button. Select the Open Library button to open the library.
Creating and Opening Models
To create a model, select the New button on the Library Browser's toolbar. To open an existing model, select the Open button on the toolbar.
Copying Blocks
To copy a block from the Library Browser into a model, select the block in the browser, drag the selected block into the model window, and drop it where you want to create the copy.
Displaying Help on a Block
To display help on a block, right-click the block in the Library Browser and select the button that subsequently pops up.
Pinning the Library Browser
To keep the Library Browser above all other windows on your desktop, select the PushPin button on the browser's toolbar.
Adding Libraries to the Library Browser
If you want a library that you have created to appear in the Library Browser, you must create an slblocks.m file that describes the library in the directory that contains it. The easiest way to create an slblocks.m file is to use an existing slblocks.m file as a template. You can find all existing slblocks.m files on your system by typing
at the MATLAB command prompt. Copy any of the displayed files to your library's directory. Then open the copy, edit it, following the instructions included in the file, and save the result. Finally, add your library's directory to the MATLAB path, if necessary. The next time you open the Library Browser, your library should appear among the libraries displayed in the browser.
| Getting Information About Library Blocks | Accessing Block Data During Simulation | ![]() |
© 1994-2005 The MathWorks, Inc.