You can package MATLAB® files to create a toolbox to share
with others. These files can include MATLAB code, data, apps,
examples, and documentation. When you create a toolbox, MATLAB generates
a single installation file (.mltbx
) that enables
you or others to install your toolbox.
To create a toolbox installation file:
In the Environment section of
the Home tab, select
Package Toolbox from
the Add-Ons menu.
In the Package a Toolbox dialog box, click the
button and select your
toolbox folder. It is good practice to create the toolbox package
from the folder level above your toolbox folder. The
.mltbx
toolbox
file contains information about the path settings for your toolbox
files and folders. By default, any of the included folders and files
that are on your path when you create the toolbox appear on their
paths after the end users install the toolbox.
In the dialog box, add the following information about your toolbox.
Toolbox Information Field | Description |
---|---|
Toolbox Name | Enter the toolbox name, if necessary. By default, the
toolbox name is the name of the toolbox folder. The Toolbox Name becomes
the |
Version | Enter the toolbox version number in the |
Author Name, Email, and Company | Enter contact information for the toolbox author. To save the contact information, click Set as default contact. |
Toolbox Image | To select an image that represents your toolbox, click Select toolbox image. |
Summary and Description | Enter the toolbox summary and description. It is good practice to keep the Summary text brief and to add detail to the Description text. |
To ensure MATLAB detects the expected components, review the toolbox contents. The following sections of the Package a Toolbox dialog box appear after you select a toolbox folder.
Package a Toolbox Dialog Box Section | Description |
---|---|
Toolbox Files and Folders | List of the folders and files contained in your toolbox. The listed files and folders are only those files that are located in the top level of the toolbox folder. You cannot navigate through the folders in the Toolbox Packaging dialog box. To exclude a file or folder from the toolbox, register it in the text file that is displayed when you click Exclude files and folders. It is good practice to exclude any source control files related to your toolbox. |
External Files | List of the files required for your toolbox that are located outside the toolbox folder. By default, MATLAB includes the required files. You can choose to omit any files you do not want in your toolbox. |
Install Actions | MATLAB Path—List of folders that are added to the user's MATLAB path when they install a toolbox. By default, the list includes any of the toolbox folders that are on your path when you create the toolbox. You can exclude folders from being added to the user's path by clearing them from the list. To manage the path for when a toolbox is installed, click Manage the current MATLAB path. To reset the list to the default list, click Reset to the current MATLAB path. Java Class Path—List of Java® files that are added to the user's dynamic Java class path when they install a toolbox. For more information, see Manage Java Class Path for Toolboxes. |
Products | List of MathWorks® products required by your toolbox. Create this list manually. |
Examples, Apps, and Documentation | List of published MATLAB examples, installable apps, and custom documentation associated with your toolbox.
|
Click Package at the top of the
Package a Toolbox dialog box. Packaging your toolbox generates a .mltbx
file
in your current MATLAB folder.
When you create a toolbox, MATLAB generates a .prj
file
that contains information about the toolbox and saves it frequently.
It is good practice to save this associated .prj
file
so that you can quickly create future revisions of your toolbox.
To share your toolbox with others, give them the .mltbx
file.
All files you added when you packaged the toolbox are included in
the .mltbx
file. When the end users install your
toolbox, they do not need to be concerned with the MATLAB path
or other installation details. The .mltbx
file
manages these details for end users.
For information on installing, uninstalling, and viewing information about toolboxes, see Get Add-Ons and Manage Your Add-Ons.
You can share your toolbox with others by attaching the .mltbx
file
to an email message, or using any other method you typically use to
share files—such as uploading to MATLAB Central File Exchange.
If you upload your toolbox to File Exchange, your users can download
the toolbox from within MATLAB. For more information, see Get Add-Ons.
Note:
While
|
matlab.addons.toolbox.installedToolboxes
| matlab.addons.toolbox.installToolbox
| matlab.addons.toolbox.packageToolbox
| matlab.addons.toolbox.toolboxVersion
| matlab.addons.toolbox.uninstallToolbox
| publish