Back to Core Functions
sum
Sum of array elements
Syntax
S = sum(A) S = sum(A, dim)
Description
Returns the sum of the elements. With a dimension argument, sums along that dimension (1-indexed).
Parameters
| Name | Description |
|---|---|
| A | Input array (scalar or NDArray) |
| dim(optional) | Dimension to sum along (1-indexed) |
Returns
Sum value (scalar or NDArray)