Sum
Sum combines its inputs in port order, multiplying each by its sign parameter before adding it.
Behavior
Section titled “Behavior”y = sign_a * a + sign_b * b [+ sign_c * c]
The block has two inputs by default and can be widened to three inputs; the optional third term is present only when input C is enabled.
| Port | Direction | Type |
|---|---|---|
| A, B, C (optional) | Input | Same numeric scalar type, or same-shape numeric arrays |
| 0 | Output | Same type as inputs |
Parameters
Section titled “Parameters”| Parameter | Type | Default |
|---|---|---|
sign_a |
Sign (1 or -1) |
1.0 |
sign_b |
Sign (1 or -1) |
1.0 |
sign_c |
Sign (1 or -1) |
1.0 when input C is enabled |
Example
Section titled “Example”With sign_a = 1, sign_b = -1, a = 7.0, and b = 2.0, the output is y = 5.0.