dotPow

x .^ y

dotPow(x, y)

Try it yourself:

See also:
pow

dotPow(): Element-Wise Powers

dotPow() raises every entry of an array or matrix to a matching exponent. It is useful for squaring residuals, applying per-channel exponents, and nonlinear transforms while preserving shape.

Choose the intended operation

dotPow differs from pow() when collections are involved: it makes entry-by-entry intent explicit. Check shapes with size(). Negative bases with non-integer exponents may not have real results, and zero raised to a negative exponent is undefined.

Pair it with dotMultiply() for weighted transformations or sqrt() for inverse square-root style work. Preserve precision for high powers, which can overflow quickly.

All functions