Main Content


Add a structure type represented by Simulink.Bus in the Simulink interface dictionary



dataType = addStructType(dictObj,dtName) adds a Simulink.Bus type with the specified name to the dictionary.


collapse all

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

%% StructType
myStructType1 = addStructType(dictAPI, 'myStructType1');
structElement1 = myStructType1.addElement('Element1');
structElement1.Type.DataType = 'single';
structElement1.Type.Dimensions = '3';
structElement2 = myStructType1.addElement('Element2');
structElement2.Type = myValueType1;
% or
structElement2.Type = 'ValueType: myValueType1';

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

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