Skip to Main Content Skip to Search
Product Documentation

j - Imaginary unit

Syntax

j
x+yj
x+j*y 

Description

As the basic imaginary unit sqrt(-1), j is used to enter complex numbers. You can also use the character i as the imaginary unit. If you want to create a complex number without using i and j, you can use the complex function.

Since j is a function, it can be overridden and used as a variable. However, it is best to avoid using i and j for variable names if you intend to use them in complex arithmetic.

If desired, you can use the character j without a multiplication sign as a suffix in forming a complex numerical constant.

For speed and improved robustness, you can replace complex i and j by 1i. For example, instead of using

a = j;

use

a = 1i;

Examples

Z = 2+3j
Z = x+j*y
Z = r*exp(j*theta)

See Also

conj | i | imag | real

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS