slCreateToolstripTab
Description
slCreateToolstripTab(
sets properties using name-value arguments. For example,
tab,component,Name=Value)slCreateToolstripTab('toolsTab',"custom",Title="Tools") creates a
Tools tab.
Examples
A Simulink Toolstrip component contains the definition for one or more custom tabs. Before you create a custom tab, you must create the component to contain it.
To work with the Simulink Toolstrip, start Simulink. For example, in the MATLAB® Command Window, enter:
start_simulink
Create a custom Simulink Toolstrip component by using the slCreateToolstripComponent function. For example, name the component
custom.
slCreateToolstripComponent("custom");The slCreateToolstripComponent function creates a
resources folder in your current folder and adds your current folder
to the MATLAB path. The resources folder contains two folders and one
JSON file.
iconsfolder — Location of icons used by custom tab elementsjsonfolder — Location of JSON files that define custom tabssl_toolstrip_plugins.json— JSON file that must not be edited
If your current folder is a project folder, instead of creating a new
resources folder, the function adds these items to the existing
resources folder in the project folder and adds the project folder to
the MATLAB path.
If your current folder belongs to an add-on and the add-on is disabled, the toolstrip
customizations specified in the resources folder are also disabled. To
enable the customizations, enable the add-on.
To load the component, the folder containing the resources folder must
be on the MATLAB path. If you remove the resources folder from the
MATLAB path after creating the component, the component does not load.
Create an untitled custom tab with the slCreateToolstripTab
function.
For example, create the tab customTab in the
custom component.
slCreateToolstripTab("customTab","custom");
The function creates a JSON file in the json folder that contains
information about the tab. For example:
{
"version": "1.0",
"entries": [
{
"type": "Tab",
"id": "customTab",
"title": ""
}
]
}Open a model. For example, open the vdp model.
openExample("simulink_general/VanDerPolOscillatorExample")The Simulink Toolstrip displays a blank tab without a title.

A Simulink Toolstrip component contains the definition for one or more custom tabs. Before you create a custom tab, you must create the component to contain it.
To work with the Simulink Toolstrip, start Simulink. For example, in the MATLAB Command Window, enter:
start_simulink
Create a custom Simulink Toolstrip component by using the slCreateToolstripComponent function. For example, name the component
custom.
slCreateToolstripComponent("custom");The slCreateToolstripComponent function creates a
resources folder in your current folder and adds your current folder
to the MATLAB path. The resources folder contains two folders and one
JSON file.
iconsfolder — Location of icons used by custom tab elementsjsonfolder — Location of JSON files that define custom tabssl_toolstrip_plugins.json— JSON file that must not be edited
If your current folder is a project folder, instead of creating a new
resources folder, the function adds these items to the existing
resources folder in the project folder and adds the project folder to
the MATLAB path.
If your current folder belongs to an add-on and the add-on is disabled, the toolstrip
customizations specified in the resources folder are also disabled. To
enable the customizations, enable the add-on.
To load the component, the folder containing the resources folder must
be on the MATLAB path. If you remove the resources folder from the
MATLAB path after creating the component, the component does not load.
Create a custom tab with the slCreateToolstripTab function.
For example, create the tab customTab in the custom
component, and title the tab CUSTOM TAB.
slCreateToolstripTab("customTab","custom",Title="CUSTOM TAB");
The function creates a JSON file named customTab.json in the
json folder that defines the tab.
Open a model. For example, open the vdp model.
openExample("simulink_general/VanDerPolOscillatorExample")The Simulink Toolstrip displays a blank tab titled CUSTOM
TAB.

Input Arguments
Tab ID, specified as a character vector or string scalar.
The tab ID appears in the JSON file that defines the tab as the value for the
id property in the JSON object where "type":
"Tab".
Data Types: char | string
Component name, specified as a character vector or string scalar.
The component name appears in the sl_toolstrip_plugins.json file as
the value for the Name property. Do not edit this file.
Data Types: char | string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: slCreateToolstripTab('customTab',"custom",Title="Custom
Tab")
Tab title, specified as a character vector or string scalar.
Tab titles use all uppercase letters even when you specify a title with lowercase letters.
The tab title appears in the JSON file that defines the tab as the value for the
title property of the JSON object where "type":
"Tab".
Data Types: char | string
Name of file that defines the tab, specified as a character vector or string scalar.
Data Types: char | string
Version History
Introduced in R2021b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)