Main Content


(Not recommended) Remove label from project

simulinkproject is not recommended. Use currentProject or openProject instead. For more information, see Compatibility Considerations.



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

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 of labels, specified as a category object. Get a category object from the proj.Categories property or by using findCategory.

Name of the label to remove, specified as a character vector.

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.

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

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

Compatibility Considerations

expand all

Not recommended starting in R2019a

Introduced in R2013a