Add
Adds or subtracts input signals.
|
|
|
Description
The Add block performs addition or subtraction of input signals. This block can add or subtract scalar, vector or matrix signals. It can also sum the elements of the signal.
The operations of the block are specified using the List of signs parameter. Available operations and symbols:
-
Addition ( +).
-
Subtraction ( -).
-
The number of + and - symbols is equal to the number of input ports of the unit.
For example, if you specify +-+ for the *List of signs parameter,* the block will have three input ports. The block subtracts the second (middle) input signal from the first (top) and then adds the third (bottom).
-
If only addition is performed, a numeric value equal to the number of inputs can be set.
Calculating the output value
Calculation of the output value for the Add block depends on the number of block inputs and the sign of the input ports:
If the block | And… | Formula for calculating the output value… | Where… |
---|---|---|---|
One input port |
Input port sign |
|
|
Input port sign |
|
||
Two or more input ports |
All characters of the input port are |
|
|
The k-th input port is the first port with the |
|
Ports
Input
Port_1 - first input signal
scalar
| vector
| matrix
Input signal for addition or subtraction operation. If there is only one input signal, the addition or subtraction is performed for all its elements.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
.
Support for complex numbers: Yes
Port_n - nth operand input signal
scalar
| vector
| matrix
n-th input signal for operations. The number of input signals corresponds to the number of signs in the List of signs parameter. The block applies operations to the input data in the specified order.
All non-scalar input data must have the same dimensions. Scalar input data is expanded to have the same dimensions as other input data.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
.
Support for complex numbers: Yes
Parameters
Main
List of signs - operations performed on the input data
++ (by default)` | +
| -
|
integer positive scalar'`
+
| -
| Enter the addition and subtraction operations performed on the input data. An input port is created for each operation.
Addition is the operation by default. The operations are performed in the order specified.
For a single vector input, + or − adds or subtracts elements across all dimensions.
If only addition is performed, you can specify a numeric value equal to the number of inputs.
Block parameter |
|
Values |
|
By default |
|
Output data type - output data type
Float 64 (by default)
| Float 32
| Float 16
| Int16
| UInt16
| Int32
| Int64
| UInt64
| UInt32
| complexF64
| complexF32
| complexF16
Select the type of data to output.
Block parameter |
|
Values |
|
* By default* |
|
Output data type method - method for specifying the output data type
Internal rule (by default)
| Same as input
| Specified
Specify the method of setting the output data type.
Block parameter |
|
Values |
|
By default |
|