Add Labels to Project Files - MATLAB & Simulink (original) (raw)

Main Content

You can use labels to organize project files and communicate information to project users.

Add Labels

To add a label to a project file, in the Files view, select the file. Then, drag the desired label from the Labels panel at the bottom left of the project into the Label Editor panel for the selected file. The Label Editor panel is located at the bottom right of theFiles view. To restore the panel if it is minimized, click the icon.

To add a label to multiple project files, in the Files view or in the Dependency Analyzer graph, select the files, right-click, and select . Choose a label from the list and clickOK.

Note

After you add a label to a file, the label persists across file revisions.

To add labels programmatically (for example, in custom task functions) seeaddLabel.

View and Edit Label Data

When you select a project file in the Files view, the file labels appear in the Label Editor view.

To change a label that belongs to a single-valued category, select the new value from the label list.

You can add additional annotations to labels from categories that you create. In the Label Editor panel, click a label and insert or modify text. Then, clickApply.

Create Labels

Labels exist in two types of categories:

All projects contain a built-in label category calledClassification with several built-in labels. These built-in labels are read-only.

To create your own label categories:

  1. In the Labels panel at the bottom left of the project, right-click and select . The Create Category dialog box opens.
  2. Enter a name for the new category.
  3. To create a single-valued label category, select the Single Valued check box. Otherwise, MATLAB® creates a multi-valued label category.
  4. To specify a label data type other than the defaultString data type, from theType list, select from the available options.
  5. Click Create.

To create your own labels in a label category:

  1. In the Labels panel at the bottom left of the project, right-click the label category and select . The Create Label dialog box opens.
  2. Enter a name for the new label and click OK.

To rename or delete a category or label, right-click it and select or .

To create a new label or label category programmatically, see createLabel or createCategory.