imag(value)

Imaginary part of a complex number.

valueThe input.
return valueThe imaginary part of the input.

In case of matrices, the result will be calculated elementwise.

imag(2+4i)