Get Simulink Project category of labels


  • category = findCategory(proj,categoryName) example



category = findCategory(proj,categoryName) returns the project category specified by categoryName. You need to get a category before you can use createLabel or removeLabel.


expand all

Get a Category of Project Labels

Open the airframe project and create a project object.

proj = simulinkproject;

Use findCategory to get a category of labels by name.

category = findCategory(proj,'Review')
category = 

  Category with properties:

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

Alternatively, you can examine categories by index. Get the first category.

ans = 

  Category with properties:

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

Find out what you can do with the category.

Methods for class slproject.Category:

createLabel          findLabel  removeLabel

Input Arguments

expand all

proj — Projectproject

Project, specified as a project object. Use simulinkproject to create a project object to manipulate a Simulink® Project at the command line.

categoryName — Name of categorystring

Name of the category to get, specified as a string.

Output Arguments

expand all

category — Category of labelscategory object

Category of labels, returned as a category object that you can query or modify. If the specified category is not found, the function returns an empty array.

See Also


Was this topic helpful?