Skip to content

i

Imaginary unit (alias for 1i); also available as I, j, J.

b = i
b = I
b = j
b = J

Returns the imaginary unit √-1. Equivalent to the literal 1i. Available under four interchangeable names — i, I, j, J — so J (engineering convention, capitalized) and i (math convention, lowercase) work the same way.

Caveat: if you assign a value to i (e.g. for i = 1:n), that local definition shadows the constant. Prefer the explicit 1i literal in numeric expressions to avoid the shadow, or use a less-common alias like I or J that you’re less likely to overwrite.

i^2 % -1
(2 + 3*i) * (1 - i) % 5 + i
I + J % 0 + 2i (same constant)
  • j — Imaginary unit, engineering notation; aliases i, I, J.