Simulink Reference | ![]() ![]() |
Library
Simulink Math Operations and Fixed-Point Blockset Math
Description
The Sum block performs addition or subtraction on its inputs. This block can add or subtract scalar, vector, or matrix inputs. It can also collapse the elements of a single input vector.
You specify the operations of the block with the List of Signs parameter. Plus (+
), minus (-
), and spacer (|
) characters indicate the operations to be performed on the inputs:
+-+
" requires three inputs and configures the block to subtract the second (middle) input from the first (top) input, and then add the third (bottom) input.
+
" characters.
+
" or "-
" will collapse the vector using the specified operation.
When the Show additional parameters check box is selected, some of the parameters that become visible are common to many blocks. For a detailed description of these parameters, refer to Block Parameters in the Fixed-Point Blockset documentation.
Data Type Support
The Sum block accepts signals of any complexity and data type, including fixed-point data types, except int64
and uint64
. The inputs may be of different data types unless the Require all inputs to have same data type parameter is selected.
Parameters and Dialog Box
+
) and minus (-
) characters as there are inputs. Addition is the default operation, so if you only want to add the inputs, enter the number of input ports. For a single vector input, "+
" or "-
" will collapse the vector using the specified operation.|
) between the signs in the List of signs parameter. For example, "++|--
" creates an extra space between the second and third input ports. Specify via dialog
, the Output data type, Output scaling value, and Lock output scaling against changes by the autoscaling tool parameters become visible.Specify via dialog
is selected for the Output data type mode parameter.Specify via dialog
is selected for the Output data type mode parameter.Specify via dialog
is selected for the Output data type mode parameter.Conversions and Operations
The Sum block first converts the input data type(s) to the output data type using the specified rounding and overflow modes, and then performs the specified operations. Refer to Rules for Arithmetic Operations in the Fixed-Point Blockset documentation for more information about the rules that this block obeys when performing fixed-point operations.
Characteristics
Dimensionalized |
Yes |
Direct Feedthrough |
Yes |
Sample Time |
Inherited from driving blocks |
Scalar Expansion |
Yes |
States |
0 |
Zero Crossing |
No |
![]() | Subsystem, Atomic Subsystem | Switch | ![]() |