| Simulink Reference | ![]() |
Library
Description
The Constant block generates a real or complex constant value. The block generates scalar (1x1 2-D array), vector (1-D array), or matrix (2-D array) output, depending on the dimensionality of the Constant value parameter and the setting of the Interpret vector parameters as 1-D parameter.
The output of the block has the same dimensions and elements as the Constant value parameter. If you specify a vector for this parameter, and you want the block to interpret it as a vector (i.e., a 1-D array), select the Interpret vector parameters as 1-D parameter; otherwise, the block treats the Constant value parameter as a matrix (i.e., a 2-D array).
Data Type Support
By default, the Constant block outputs a signal whose data type and complexity are the same as that of the block's Constant value parameter. However, you can specify the output to be any supported data type supported by Simulink, including fixed-point data types.
For a discussion on the data types supported by Simulink, refer to Data Types Supported by Simulink in the Using Simulink documentation.
Parameters and Dialog Box
The Main pane of the Constant block dialog appears as follows:
Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters in the online Simulink documentation for details.
true or false, that evaluates to a matrix value. The Constant value parameter is converted from its data type to the specified output data type offline using round-to-nearest and saturation.
N if the Constant value parameter evaluates to an N-element row or column vector, i.e., a matrix of dimension 1xN or Nx1.
inf, i.e., the block's output can never change. This setting speeds simulation and generated code by avoiding the need to recompute the block's output. See Specifying Sample Time in the online documentation for more information.
The Signal data types pane of the Constant block dialog appears as follows:
int8(29). You can also choose a built-in data type from the list. If you choose Specify via dialog, the following parameters become visible.
Specify via dialog for the Output data type mode parameter.
Specify via dialog for the Output data type mode parameter.
Specify via dialog for the Output data type mode parameter and Use specified scaling for the Output Scaling Mode parameter.
Characteristics
| Direct Feedthrough |
N/A |
| Sample Time |
Specified in the Sample time parameter |
| Scalar Expansion |
No |
| Dimensionalized |
Yes |
| Zero Crossing |
No |
| Configurable Subsystem | Cosine | ![]() |
© 1994-2005 The MathWorks, Inc.