Documentation

createCategory

Create category of金宝appProject labels

Syntax

createCategory(proj,categoryName)
createCategory(proj,categoryName,dataType)
createCategory(proj,categoryName,dataType, single-valued)

Description

example

createCategory(proj,categoryName)创建一个新类别的标签categoryNamein the projectproj.

example

createCategory(proj,categoryName,dataType)specifies the class of data to store in labels of the new category.

example

createCategory(proj,categoryName,dataType,single-valued)specifies a single-valued category, where you can attach only one label from the category to a file. If you do not specify single-valued, then you can attach multiple labels from the category to a file.

Examples

collapse all

Create a new category of labels for file ownership, and attach a new label and label data to a file.

Open the airframe project and create a project object.

sldemo_slproject_airframe proj = simulinkproject;

Create a new category of labels, calledEngineers, to denote file ownership in a project. These labels have the chardatatypefor attaching character vector data.

createCategory(proj,'工程师','char');

UsefindCategoryto get the new category.

engineersCategory = findCategory(proj,'工程师');

Create labels in the new category.

createLabel(engineersCategory,'Tom'); createLabel(engineersCategory,'Dick') createLabel(engineersCategory,'哈利')

Attach one of the new labels to a file in the project.

myfile = findFile(proj,'models/AnalogControl.mdl') addLabel(myfile,'工程师','Tom');

Get the label and add data.

label = findLabel(file,'工程师','Tom'); label.Data ='Maintenance responsibility'; disp(label)
Label with properties: File: [1x80 char] Data: 'Maintenance responsibility' DataType: 'char' Name: 'Tom' CategoryName: 'Engineers'

Open the airframe project and create a project object.

sldemo_slproject_airframe proj = simulinkproject;

Create a new category of labels.

createCategory(proj,'Coverage','double')
category = Category with properties: Name: 'Coverage' DataType: 'double' LabelDefinitions: []

Find out what you can do with the new category.

类别= findCategory(项目,'Coverage'); methods(category)
Methods for class slproject.Category: findLabel removeLabel createLabel

Open the airframe project and create a project object.

sldemo_slproject_airframe proj = simulinkproject;

为文件所有权创建类别的标签,并指定单价值以限制每个文件类别中的一个标签。

createCategory(proj,'工程师','char','single-valued');

Input Arguments

collapse all

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

Name of the category of labels to create, specified as a character vector.

The class of data to store in labels in the new category, specified as a character vector.

Single-valued category, specified as a character vector. Single-valued means you can attach only one label from the category to a file. If you do not specify single-valued, then you can attach multiple labels from the category to a file.

Tips

After you create a new category, you can create labels in the new category. SeecreateLabel.

See Also

Functions

Introduced in R2013a

Was this topic helpful?