The Octave Forge package repository is no longer actively maintained. Please find Octave Packages at https://packages.octave.org.

Navigation

Operators and Keywords

Function List:

C++ API

Method on @sym: sum (x)
Method on @sym: sum (x, n)

Sum of symbolic expressions.

Sum over the rows or columns of an expression. By default, sum over the rows. Can specify row or column sums using n. To perform symbolic summations, see ‘@sym/symsum’.

Examples:

syms x y z
sum([x y z])
  ⇒ (sym) x + y + z

sum([x y; x z], 1)
  ⇒ (sym) [2⋅x  y + z]  (1×2 matrix)

sum([x y; x z], 2)
  ⇒ (sym 2×1 matrix)
      ⎡x + y⎤
      ⎢     ⎥
      ⎣x + z⎦

See also: @sym/prod, @sym/symsum.

Package: symbolic