elementssum

Calculates the sum of the vector or matrix elements.

Arguments

  1. Input vector or matrix.
  2. String 'row' or 'col', 'row' to sum row elements and 'col' to sum column elements.

Output

Double value or vector

Examples

elementssum