Contenu principal

slLibraryBrowser

R2026b

Open, load, and close Simulink Library Browser, create and get handle of Library Browser object

Description

slLibraryBrowser opens the Simulink® Library Browser in standalone mode. For more information on standalone mode, see Library Browser in Standalone Mode.

Note

  • If you want to load the Simulink block library, use load_system simulink instead.

  • If you want to start Simulink without opening any windows, use the faster start_simulink instead.

example

handle = slLibraryBrowser creates the Library Browser object LibraryBrowser.LBStandalone and returns the object handle. When you have the object handle, you can use the object properties and functions to display, hide, size, position, and refresh the Library Browser in standalone mode. For more information, see Library Browser in Standalone Mode, LibraryBrowser.LBStandalone, show, hide, getPosition, setPosition, and refresh.

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.

Note

You can also use LibraryBrowser.LibraryBrowser2 to create and get the handle of the Library Browser object. LibraryBrowser.LibraryBrowser2 does not open a Library Browser in standalone mode or move the Library Browser in front of other Simulink windows.

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

slLibraryBrowser("noshow") loads the Library Browser in memory without making it visible.  Use this to make future calls to slLibraryBrowser("open") faster.

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

Examples

collapse all

Programmatically open the Library Browser and then move the Library Browser to the top of all the open Simulink Editor windows.

Create a LibraryBrowser.LBStandalong object and get its handle.

h = slLibraryBrowser;

Open the Library Browser.

slLibraryBrowser

Click an open Simulink model to give the model window focus. Drag the model window on top of the Library Browser.

Programmatically move the Library Browser to the top of all the open Simulink Editor windows. To do so, set the IsOnTop value of the LibraryBrowser.LBStandalong object to a value of 1.

h.IsOnTop = 1;

Output Arguments

collapse all

Handle of Library Browser object LibraryBrowser.LBStandalone, returned as a numeric scalar.

Data Types: double

Limitations

The slLibraryBrowser function does not act on a docked Library Browser. To use the slLibraryBrowser function, open the Library Browser in standalone mode by clicking the Launch standalone library browser button Launch standalone library browser button.

Version History

Introduced in R2016a

expand all