removeLabel

Remove label from Simulink Project

Syntax

  • removeLabel(category,labelName) example
  • removeLabel(file,categoryName,labelName) example
  • removeLabel(file,labelDefinition)

Description

example

removeLabel(category,labelName) removes the label from the specified category of labels in the currently loaded project.

example

removeLabel(file,categoryName,labelName) removes the specified label in the category categoryName from the file. Use this syntax to specify category and label by name.

removeLabel(file,labelDefinition) removes the specified label labelDefinition from the file. Before you can remove the label, you need to get the label from the file.Label property or by using findLabel.

Examples

expand all

Remove a Label

Open the airframe project and create a project object.

sldemo_slproject_airframe;
proj = simulinkproject;

Examine the first existing category.

cat = proj.Categories(1)
cat = 

  Category with properties:

                Name: 'Review'
            DataType: 'char'
    LabelDefinitions: [1x4 slproject.LabelDefinition]

Define a new label in the category.

createLabel(cat,'review me');

Remove the new label.

removeLabel(cat,'review me');

Alternatively, remove the label from the project by specifying the category by name.

removeLabel(proj,'Review','review me');

Input Arguments

expand all

category — Category of labelscategory object

Category of labels, specified as a category object. Get a category object from the proj.Categories property or by using findCategory.

labelName — Name of labelstring

Name of the label to remove, specified as a string.

file — File to detach label fromfile object

File to detach the label from, specified as a file object. You can get the file object by examining the project's Files property (proj.Files), or use findFile to find a file by name. The file must be within the root folder.

categoryName — Name of category that contains labelstring

Name of the category that contains the label to remove, specified as a string.

labelDefinition — Label to detachlabel definition object

Name of the label to detach, specified as a label definition object returned by the file.Label property or findLabel.

Was this topic helpful?