j
Imaginary unit
Syntax
Description
1j returns the basic imaginary unit. j is
equivalent to sqrt(-1).
You can use j to enter complex numbers.
You also can use the character i as the imaginary
unit. To create a complex number without using i and j,
use the complex function.
Examples
Input Arguments
Output Arguments
Tips
- For speed and improved robustness in complex arithmetic, use - 1iand- 1jinstead of- iand- j.
- Since - jis a function, it can be overridden and used as a variable. However, it is best to avoid using- iand- jfor variable names if you intend to use them in complex arithmetic.
- Use the - complexfunction to create a complex output in the following cases:- When the names - iand- jmight be used for other variables (and do not equal- sqrt(-1))
- When the inputs are not - doubleor- single
- When the imaginary component is all zeros 
 
Extended Capabilities
Version History
Introduced before R2006a