Main Content

addValueType

Create named value type in data dictionary

Since R2021b

Description

valueType = addValueType(dictionary,name) adds a named value type to a specified data dictionary.

To remove a value type, use the destroy function.

example

valueType = addValueType(dictionary,name,Name=Value) adds a named value type to a specified data dictionary with additional options.

Examples

collapse all

Create a data dictionary and add a value type airSpeed.

dictionary = systemcomposer.createDictionary("new_dictionary.sldd");
airSpeedType = addValueType(dictionary,"airSpeed")

Create a new model and link the data dictionary to the model. Then, open the Interface Editor to view the new interface.

arch = systemcomposer.createModel("newModel");
systemcomposer.openModel("newModel");
linkDictionary(arch,"new_dictionary.sldd");

Input Arguments

collapse all

Data dictionary, specified as a systemcomposer.interface.Dictionary object. For information on how to create a data dictionary, see createDictionary.

Name of new value type, specified as a character vector or string. This name must be a valid MATLAB® identifier.

Example: "airSpeed"

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: addValueType(dictionary,"airSpeed",DataType="double",Dimensions="2",Units="m/s",Complexity="complex",Minimum="0",Maximum="100",Description="Maintain altitude")

Data type of value type, specified as a character vector or string for a valid MATLAB data type. The default value is double.

Example: addValueType(dictionary,"airSpeed",DataType="double")

Data Types: char | string

Dimensions of value type, specified as a character vector or string. The default value is 1.

Example: addValueType(dictionary,"airSpeed",Dimensions="2")

Data Types: char | string

Units of value type, specified as a character vector or string.

Example: addValueType(dictionary,"airSpeed",Units="m/s")

Data Types: char | string

Complexity of value type, specified as a character vector or string. The default value is real. Other possible values are complex and auto.

Example: addValueType(dictionary,"airSpeed",Complexity="complex")

Data Types: char | string

Minimum of value type, specified as a character vector or string.

Example: addValueType(dictionary,"airSpeed",Minimum="0")

Data Types: char | string

Maximum of value type, specified as a character vector or string.

Example: addValueType(dictionary,"airSpeed",Maximum="100")

Data Types: char | string

Description of value type, specified as a character vector or string.

Example: addValueType(dictionary,"airSpeed",Description="Maintain altitude")

Data Types: char | string

Output Arguments

collapse all

Value type, returned as a systemcomposer.ValueType object.

More About

collapse all

Version History

Introduced in R2021b

See Also

Functions

Objects

Blocks

Tools