Using Simulink     Search    Help Desk 
Gain

Multiply block input.

Library

Math

Description

The Gain block generates its output by multiplying its input by a specified constant, variable, or expression.You can enter the gain as a numeric value, or as a variable or expression. To multiply the input by a matrix, use the Matrix Gain block (see 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 except boolean 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:

Parameters and Dialog Box

Gain
The gain, specified as a scalar, vector, variable name, or expression. The default is 1. If not specified, the data type of the Gain parameter is double.
Saturate on integer overflow
If selected, this option causes the output of the Gain block to saturate on integer overflow. In particular, if the output data type is an integer type, the block output is the maximum value representable by the output type or the computed output, whichever is smaller in the absolute sense. If the option is not selected, Simulink takes that action specified by the Data overflow event option on the Diagnostics page of the Simulation Parameters dialog box (see "The Diagnostics Page").

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
Of input and Gain parameter
States
0
Vectorized
Yes
Zero Crossing
No



[ Previous | Help Desk | Next ]