Main Content

addAliasType

Add a Simulink alias type to Simulink Interface Dictionary

Description

example

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

Examples

collapse all

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

%% Alias Types
myAliasType1 = addAliasType(dictAPI, 'aliasType', BaseType='single');
myAliasType1.Name = 'myAliasType1';
myAliasType1.BaseType = 'fixdt(1,32,16)';
 
myAliasType2 = addAliasType(dictAPI, 'myAliasType2');
% can also use interface dict type objs
myAliasType2.BaseType = myAliasType1;

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