Main Content
sum
Sum of fi
array elements
Description
returns the
sum along different dimensions of the S
= sum(A
)fi
array
A
.
If
A
is a vector,sum(
returns the sum of the elements.A
)If
A
is a matrix,sum(
treats the columns ofA
)A
as vectors, returning a row vector of the sums of each column.If
A
is a multidimensional array,sum(
treats the values along the first non-singleton dimension as vectors, returning an array of row vectors.A
)
Examples
Input Arguments
Output Arguments
Limitations
sum
does not supportfi
objects of data typeBoolean
.
Extended Capabilities
Version History
Introduced before R2006a