| Using Simulink | Search  Help Desk |
| Gain |
Library
MathDescription
Matrix Gain).
The Gain block icon displays the value entered in the Gain parameter field if the block is large enough. If the gain is specified as a variable, the block displays the variable name, although if the variable is specified in parentheses, the block evaluates the variable each time the block is redrawn and displays its value. If the Gain parameter value is too long to be displayed in the block, the string -K- is displayed.
To modify the gain during a simulation using a slider control (see Slider Gain).
Data Type Support
A Gain block accepts a real- or complex-valued scalar or vector of any data type exceptboolean and outputs a signal of the same data type as its input. The elements of an input vector must be of the same type. A Gain blocks Gain parameter can also be a real- or complex-valued scalar or vector of any data type. A Gain block observes the following type rules:
uint8 and the gain is -1, an error results. If typecasting the gain parameter to the input data type results in a loss of precision, Simulink issues a warning and continues the simulation.
int8, the actual output is 128 if the computed output is greater than 128 and -128 if the computed output is less than -128.
Parameters and Dialog Box

1. If not specified, the data type of the Gain parameter is double.Characteristics
| Direct Feedthrough |
Yes |
| Sample Time |
Inherited from driving block |
| Scalar Expansion |
Of input and Gain parameter |
| States |
0 |
| Vectorized |
Yes |
| Zero Crossing |
No |