Skip to content

sumxpy2

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

c = sumxpy2(A, B)

Returns sum((A + B).^2) computed in one pass — useful for vector-norm computations and squared-quantity accumulations.

sumxpy2([1 2], [3 4]) % 52 (= 16 + 36)
  • sumxmy2 — Sum of squared differences between paired arrays.
  • sumx2py2 — Sum of (x² + y²) over paired arrays.
  • sum — Sum elements of an array.