Main Content

Add Labels to Project Files

您可以使用labels to organize project files and communicate information to project users.

Add Labels

To add a label to a project file, in theFilesview, select the file. Then, drag the desired label from theLabelspanel 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 theFilesview. To restore the panel if it is minimized, click theicon.

To add a label to multiple project files, in theFilesview or in the Dependency Analyzer graph, select the files, right-click, and selectAdd Label. 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

当你选择的项目文件Filesview, 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:

  • Single-valued — You can attach only one label from the category to a file.

  • Multi-valued — You can attach multiple labels from the category to a file.

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

To create your own label categories:

  1. In theLabelspanel at the bottom left of the project, right-click and selectCreate New Category. The Create Category dialog box opens.

  2. Enter a name for the new category.

  3. To create a single-valued label category, select theSingle Valuedcheck box. Otherwise, MATLAB®creates a multi-valued label category.

  4. To specify a label data type other than the defaultStringdata type, from theTypelist, select from the available options.

  5. ClickCreate.

To create your own labels in a label category:

  1. In theLabelspanel at the bottom left of the project, right-click the label category and selectCreate New Label. The Create Label dialog box opens.

  2. Enter a name for the new label and clickOK.

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

To create a new label or label category programmatically, seecreateLabelorcreateCategory.

Related Topics