Computes the sum of inputs along the specific dimension.
c = sum(a)
c = sum(a, b)
c = sum(a, b, d)
Scalar or array of any dimension of numeric or Boolean values.
Dimension along which to compute the sum. b can be in a range of 1 to the maximum supported array dimension (32). If you do not assign a value to b, MathScript uses the first dimension whose size is not equal to 1.
Output data type.
Output data type is double.
Output data type is the same data type as the input.
Sum of all elements in a. c is the same size as a, except for the dimension the function works on. The size for the working dimension of c is 1.
A = [1:1:15] C = sum(A)
Where This Node Can Run:
Desktop OS: Windows
FPGA: This product does not support FPGA devices