Simulink.AliasType
Create alias for signal and parameter data type
Description
Use a Simulink.AliasType
to create an alias of a built-in
data type such as int8
.
The name of the object is the alias. The data type to which an alias refers, such as
int8
, is the base type. Alias names cannot be:
Built-in data types, including:
Floating-point types:
half
,single
,double
Integer types:
int8
,uint8
,int16
,uint16
,int32
,uint32
,int64
, oruint64
.string
Fixed-Point Designer™ types beginning with
sfix
,ufix
, orflt
.boolean
You create the object in the base workspace or a data dictionary. To use the alias, you use the name of the object to set data types for signals, states, and parameters in a model.
Using aliases to specify signal and parameter data types can greatly simplify global changes to the data types that a model specifies. In particular, changing the data type of all signals, states, and parameters whose data type is specified by an alias requires changing only the base type of the alias. By contrast, changing the data types of signals, states, and parameters whose data types are specified by an actual type name requires respecifying the data type of each signal and parameter individually.
You can use objects of this class to create an alias for Simulink® built-in data types, fixed-point data types, enumerated data types,
Simulink.NumericType
objects, and other Simulink.AliasType
objects. The code that you generate from a model (Simulink
Coder™) uses the alias only if you use an ERT-based system target file (Embedded Coder®).
Alternatively, to define and name a numeric data type, you can use an object of the
class Simulink.NumericType
.
Creation
You can create a Simulink.AliasType
object several ways.
Interactively create a data type alias using the Type Editor or Model Explorer.
Generate data type aliases that correspond to
typedef
statements in your external C code using theSimulink.importExternalCTypes
function.Programmatically create a data type alias using the
Simulink.AliasType
function described here.
Note
You must create data type aliases in the MATLAB® workspace or in a data dictionary. You cannot create an alias in a model workspace.
Properties
Examples
Extended Capabilities
Version History
Introduced before R2006a