sum

The algebraic sum function.

Syntax

sum(expr)

Argument

expr
A valid scalar, vector, or matrix expression.

Example

Templex Expression Results
{sum(6)} 6
{sum( {1, 2, 3, 4, 5} )} 15
{sum( { {1, 0}, {0, -1} } )} 0

Comments

The sum function returns the aggregate value of the components of expr. The result is a scalar.