Main Content

addValueType

Add a value type to Simulink Interface Dictionary

Description

example

dataType = addValueType(dictObj,dtName) adds a Simulink.ValueType with the specified name to the dictionary.

Examples

collapse all

To add a Simulink.ValueType with the specified name to the dictionary, use the addValueType function. For an example that shows more of the workflow for related functions, see Create and Configure Interface Dictionary.

%% ValueType
myValueType1 = addValueType(dictAPI, 'myValueType1');
myValueType1.DataType = 'int32';
myValueType1.Dimensions = '[2 3]';
myValueType1.Description = 'I am a Simulink ValueType';
myValueType1.DataType = myEnumType1;

Input Arguments

collapse all

Interface dictionary, specified as a Simulink.interface.Dictionary object. Before you use this function, represent the target dictionary with a Simulink.interface.Dictionary object by using Simulink.interface.dictionary.create or Simulink.interface.dictionary.open.

DataType definition name in DataTypes property array of dictObj, specified as a character vector or a string scalar.

Example: "airSpeed"

Output Arguments

collapse all

Data type of dtName, specified as a character vector or string for a valid MATLAB data type.

Version History

Introduced in R2022b