| angle | R Documentation |
Basic complex functions (Matlab style)
Real(z)
Imag(z)
angle(z)
z |
Vector or matrix of real or complex numbers |
These are just Matlab names for the corresponding functions in R. The
angle function is simply defined as atan2(Im(z), Re(z)).
returning real or complex values; angle returns in radians.
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.
Mod, abs
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.