Main Content

Library Browser in Standalone Mode

Use standalone Library Browser to find and add blocks to model

Description

You can use the Library Browser in docked mode or in standalone mode. By default, the Library Browser is in docked mode, so the Library Browser window stays to one side of the model and does not cover areas in the model canvas where you want to add items. A Library Browser that is not docked is in standalone mode.

Use standalone mode to:

  • Add the same items to many Simulink® windows.

  • View the Library Browser in full-screen mode.

  • Open, close, hide, or position the Library Browser programmatically.

  • Browse the libraries without opening a Simulink model.

For an introduction to the Library Browser and more information about docked mode, see Library Browser.

The image shows the Library Browser in standalone mode. In standalone mode, the Library Browser has two panes. The pane on the left is called the libraries pane. The pane on the right is called the blocks pane. Labels are on the libraries pane, the tree that it contains, the blocks pane, and the search box.

Library Browser in standalone mode

Open the Library Browser in Standalone Mode

  • Open from Library Browser in docked mode: Click the Launch standalone library browser button Launch standalone library browser button.

  • Open from MATLAB® Command Window: Enter slLibraryBrowser('open').

Note

You can only open one Library Browser in standalone mode.

Examples

expand all

You can use these keyboard shortcuts to interact with the Library Browser in standalone mode.

TaskShortcut
Move selection downDown arrow
Move selection upUp arrow
Expand a libraryRight arrow
Collapse a libraryLeft arrow
Navigate to parent libraryEsc
Move to page you visited before current pageAlt+left arrow
Move to page you visited after current pageAlt+right arrow

Insert selected block in active model

Note

If no model is open, Add block to a new model creates new model and adds the selected block to it.

Ctrl+I
Find a block

Ctrl+F or F3

Navigate from search result to library containing blockCtrl+R
Refresh librariesF5
Increase zoomCtrl+Plus (+)
Decrease zoomCtrl+Minus (-)
Reset zoom to defaultAlt+1
Close Library BrowserCtrl+W

Note

When you use the keyboard shortcuts on a Mac:

  • Press command (⌘) instead of Ctrl.

  • Press option instead of Alt.

To navigate the Library Browser in standalone mode, expand the hierarchy of libraries in the tree on the libraries pane.

You can have multiple libraries expanded at once.

To view the contents of a library, click the library name in the tree. The library contents appear in the blocks pane of the Library Browser window.

Library contents can be any combination of blocks, annotations, and libraries that are at a lower level in the hierarchy.

To select the parent library of the open library, right-click any item in the open library and click Go to parent.

To search for a library item using key words or phrases, use the search box at the top of the Library Browser.

  1. In the search box, type the search term or select it from the list of recent search terms.

    Library Browser search box

    To search for an annotation, type any of the text from the annotation or its description.

  2. To use regular expressions, case-sensitive search, or whole-word search, click the Search for subsystems, blocks, and annotations button and select the search options you want to use.

    Library Browser search options menu

  3. Press Enter to start the search. The blocks pane displays the search results, grouped by library.

    If there are more than 100 search results, the results take up multiple pages in the blocks pane. To navigate to the previous or next page of results, use the arrows in the upper left corner of the Library Browser window.

    The image shows the top of the Library Browser in standalone mode with the keyword "add" in the search box. The Search Results tab is open, and the line of text right below the tab title shows a two arrows, one pointing left and one pointing right, and the text "Page 1 of 4 (304 Blocks found)."

    To see where the search string matches, pause on a block.

    To navigate to the library that contains an item in the search results, right-click the item and select Select in library view.

As an example, search for the customizable Knob block.

  1. In the search box at the top of the Library Browser, enter the keyword knob.

  2. Press Enter. The blocks pane shows the search results, which are two Knob blocks.

  3. Pause over the two blocks to find out which is the customizable Knob block. When you pause over the customizable Knob block, this text appears: simulink_hmi_customizable_blocks/Knob.

    The Library Browser in standalone mode shows the search results for the keyword "knob." The search results are two Knob blocks. The pointer is hovering over the Knob block on the right, and a tooltip is visible with the text "simulink_hmi_customizable_blocks/Knob."

To add blocks and annotations from the Library Browser to an open model, right-click the block or annotation and select Add block to model or Add block to a new model. If no model is open, the Add block to a new model creates a model and adds the block to it.

Blocks that you have recently added to your model from the Library Browser appear in the Recently Used library at the bottom of the tree.

As an example, add a customizable Vertical Gauge block to an open model.

  1. In the search box at the top of the Library Browser, enter vertical gauge.

  2. Press Enter. The block pane shows the Vertical Gauge block.

  3. Right-click the Vertical Gauge block and select Add block to model.

    The Library Browser in standalone mode shows the search results for the key phrase "vertical gauge." The search results consist of a single block, the Vertical Gauge block. The Vertical Gauge block is right-clicked, and the context menu is open. The pointer hovers over the option "Add block to model vdp".

When you resize the libraries panel, the library contents flow to match the width of the window.

You can also programmatically customize the appearance of the Library Browser.

  • Set the sort priority to change the order of the libraries in the tree.

  • Hide libraries.

  • Deactivate libraries.

  • Expand or collapse libraries in the tree.

For more information and examples, see Customize Library Browser Appearance.

The libraries and library contents are first sorted by sort priority and then by sorting order.

Libraries appear in ascending order of sort priority. By default, the Simulink library has a sort priority of -1, and all other libraries have a sort priority of 0. For more information about sort priority, see Customize Library Browser Appearance.

By default, the sorting order is alphabetical. Sublibraries appear first, then subsystems, then blocks, and then annotations.

You can change the sorting order to model order, the order set by the library developer. Typically, model order sorts the contents according to functionality and group related blocks together.

Note

In standalone mode, you can only change the sorting order in the blocks pane. The sorting order of the tree is always alphabetical.

To switch from alphabetical order to model order in standalone mode, right-click the blocks pane or a library item in the blocks pane and select Sort in library model order. This setting is preserved from session to session.

To return to the alphabetical order, right-click the blocks pane or a library item in the blocks pane and select Sort in alphabetical order.

Some libraries do not follow the sorting order. For example, in the Simulink library, the Quick Insert library appears as the last item regardless of the sorting option you choose.

As an example, sort the contents of the Simulink library in model order.

  1. In the Library Browser tree, select the Simulink library.

  2. In the Simulink library, right-click any sublibrary, for example the Dashboard library, and select Sort in library model order. The order of the library changes to model order. In model order, related libraries are grouped together. For example, the Continuous and Discrete sublibraries have two other sublibraries between them when the Simulink library is in alphabetical order but follow each other when the sublibrary is in model order.

    The top image shows the standalone Library Browser with the Simulink Library selected. The contents of the Simulink Library shown in the blocks pane are sublibraries, sorted in alphabetical order. The image marks the Continuous sublibrary and the Discrete sublibrary, which are located in the same row, but with two other libraries between them. The bottom image shows the same Library Browser, but the contents of the Simulink Library are sorted in model order. The image marks the Continuous sublibrary and the Discrete sublibrary, which are right next to each other.

To keep the Library Browser in front of other Simulink windows, in the Library Browser toolbar, click Stay on Top Stay on Top button.

To turn off this setting, click Stay on Top again.

For information on how to turn on this setting programmatically, see Keep Library Browser in Front of Other Windows.

Programmatic Use

expand all

libraryhandle = slLibraryBrowser creates the Library Browser object LibraryBrowser.LBStandalone and returns the object handle.

When you use slLibraryBrowser to get the object handle:

  • If the Library Browser is open in standalone mode, the Library Browser window moves in front of all other Simulink windows.

  • If the Library Browser is not open in standalone mode, the Library Browser opens in standalone mode.

slLibraryBrowser('close') closes the Library Browser in standalone mode.

slLibraryBrowser('open') opens the Library Browser in standalone mode.

slLibraryBrowser('noshow') loads the Library Browser in memory without making it visible. Use this command to quickly open the Library Browser programmatically in standalone mode.

Version History

Introduced before R2006a

expand all