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
Create Untitled Custom Tab in Simulink Toolstrip
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");
This command 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.
icons
folder — Location of icons used by custom tab elementsjson
folder — Location of JSON files that define custom tabssl_toolstrip_plugins.json
— JSON file that must not be edited
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.
Create Titled Custom Tab in Simulink Toolstrip
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");
This command 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.
icons
folder — Location of icons used by custom tab elementsjson
folder — Location of JSON files that define custom tabssl_toolstrip_plugins.json
— JSON file that must not be edited
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
— Tab ID
character vector | string scalar
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
— Component name
character vector | string scalar
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")
Title
— Tab title
""
(default) | character vector | string scalar
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
FileName
— Name of file that defines tab
<tabname>
.json
(default) | character vector | string scalar
<tabname>
.jsonName 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)