| Simulink Reference | ![]() |
Create an alias for a signal and/or parameter data type
Description
This class allows you to designate MATLAB variables as aliases for signal and parameter data types. You do this by creating instances of this class and assigning them to variables in the MATLAB or model workspaces (see Creating a Data Type Alias). The MATLAB variable to which a Simulink.AliasType object is assigned is called a data type alias. The data type to which an alias refers is called its base type. Simulink allows you to set the BaseType property of the object that the variable references, thereby designating the data type for which it is an alias.
Simulink lets you use aliases instead of actual type names in dialog boxes and set_param commands to specify the data types of Simulink block outputs and parameters. Using aliases to specify signal and parameter data types can greatly simplify global changes to the signal and parameter data types that a model specifies. In particular, changing the data type of all signals and parameters whose data type is specified by an alias requires only changing the base type of the alias. By contrast, changing the data types of signals and parameters whose data types are specified by an actual type name requires respecifying the data type of each signal and parameter individually, a tedious and time-consuming process.
Creating a Data Type Alias
You can use either the Model Explorer or MATLAB commands (see MATLAB Commands for Creating Data Type Aliases) to create a data type alias.
To use the Model Explorer to create an alias,
Simulink.AliasType object and assigns it to a variable named Alias in the MATLAB workspace.
double (the default).
MATLAB Commands for Creating Data Type Aliases
Use the following syntax to create a data type alias at the MATLAB command line or in a MATLAB program
where ALIAS is the name of the variable that you want to serve as the alias. For example, the following line creates an alias names MyFloat.
The following notations get and set the properties of a data type alias, respectively,
where ALIAS is the name of the alias, PROPNAME is the name of the alias object's properties, and PROPVALUE is the property's value. For example, the following code saves the current value of MyFloat's BaseType property and assigns it a new value.
See the "Properties" section below for information on the names, permitted values, and usage of the properties of data type alias objects.
Property Dialog Box
double. To specify another data type, select the data type from the adjacent pull-down list of standard data types or enter the data type's name in the edit field. Note that you can, with one exception, specify a nonstandard data type, e.g, a data type defined by a Simulink.NumericType object, by entering the data type's name in the edit field. The exception is a Simulink.NumericType whose Category is Fixed-point: unspecified scaling.
Properties
| Name |
Description |
BaseType |
A string specifying the name of a standard or custom data type. (Base type) |
Description |
A string that describes the usage of the data type. May be a null string. (Description) |
HeaderFile |
A string that specifies the name of a C header file that defines a data type having the same name as the alias. (Header file) |
| EventData | Simulink.BlockCompDworkData | ![]() |
© 1994-2005 The MathWorks, Inc.