Learn R Programming

pracma (version 1.1.6)

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

Value

  • returning real or complex values; angle returns in radians.

Details

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

See Also

Mod, abs

Examples

Run this code
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)

Run the code above in your browser using DataLab