Skip to content

mag

Magnitude (modulus) of a complex number.

Y = mag(X)

Returns sqrt(real(X)^2 + imag(X)^2) element-wise. Synonym for abs on complex inputs.

mag(3 + 4i) % 5
  • abs — Absolute value.
  • norm — Vector or matrix norm.
  • phase — Phase angle of a complex number (radians).