Main Content

slLoadedToolstripComponents

Find loaded custom Simulink Toolstrip components

Since R2021b

Description

components = slLoadedToolstripComponents returns the name, path, and persistence of loaded custom Simulink® Toolstrip components.

example

Examples

collapse all

Suppose you have a custom tab that you want to remove from the Simulink Toolstrip.

Find the loaded custom Simulink Toolstrip components. In the MATLAB® Command Window, enter:

components = slLoadedToolstripComponents
components = 

  1×2 struct array with fields:

    name
    path
    persisted

The function finds two loaded components.

Get information about the first component.

components(1)
ans = 

  struct with fields:

         name: 'tools'
         path: 'B:\path\components\tools'
    persisted: 0

The function returns the name (tools), path (B:\path\components\tools), and persistence (0) of the component. This component does not persist across MATLAB sessions.

Get information about the second component.

components(2)
ans = 

  struct with fields:

         name: 'custom'
         path: 'B:\path\customtab'
    persisted: 1

The function returns the name (custom), path (B:\path\customtab), and persistence (1) of the component. This component persists across MATLAB sessions.

Inspect the JSON files in the B:\path\customtab\resources\json folder of the second component to determine whether the second component defines the custom tab you want to remove. Also check whether the component defines custom tabs that you want to keep.

Remove the custom tab by performing one of these actions:

  • Remove the parent folder of the resources folder from the MATLAB path.

  • Stop the custom Simulink Toolstrip component from persisting across MATLAB sessions by using the slPersistToolstripComponent function.

  • Rename the resources folder to prevent it from being found.

  • Edit the JSON file that defines the custom tab.

  • Destroy the custom Simulink Toolstrip component using the slDestroyToolstripComponent function.

Then, reload the toolstrip configuration.

slReloadToolstripConfig;

Output Arguments

collapse all

Name, path, and persistence of loaded components, returned as a structure array.

Version History

Introduced in R2021b