Remove label from Simulink Project


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



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


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.


collapse all

Remove a Label

Open the airframe project and create a project object.

proj = simulinkproject;

Examine the first existing category.

cat = proj.Categories(1)
cat = 

  Category with properties:

                Name: 'Classification'
            DataType: 'none'
    LabelDefinitions: [1x8 slproject.LabelDefinition]

Define a new label in the category.


Remove the new label.


Input Arguments

collapse 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.

Introduced in R2013a

Was this topic helpful?