Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

angle

Basic Complex Functions


Description

Basic complex functions (Matlab style)

Usage

Real(z)
Imag(z)
angle(z)

Arguments

z

Vector or matrix of real or complex numbers

Details

These are just Matlab names for the corresponding functions in R. The angle function is simply defined as atan2(Im(z), Re(z)).

Value

returning real or complex values; angle returns in radians.

Note

The true Matlab names are real, imag, and conj, but as real was taken in R, all these beginnings are changed to capitals.

The function Mod has no special name in Matlab; use abs() instead.

See Also

Examples

z <- c(0, 1, 1+1i, 1i)
Real(z)   # Re(z)
Imag(z)   # Im(z)
Conj(z)   # Conj(z)
abs(z)    # Mod(z)
angle(z)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.