Skip to content

sumxpy

Sum of element-wise sums: sum(A + B).

c = sumxpy(A, B)

Returns sum(A + B) computed in one pass (skipping the intermediate elementwise array). Useful for performance-critical inner loops.

sumxpy([1 2 3], [4 5 6]) % 21 (= sum of [5 7 9])
  • sumxmy — Sum of element-wise differences: sum(A - B).
  • sumxpy2 — Sum of squared element-wise sums: sum((A + B).^2).
  • sum — Sum elements of an array.