C2R {conformal} | R Documentation |
Convert objects to a real vector representation of a complex vector
C2R(z) listxy2R(lxy) matrix2R(x)
z |
A complex vector |
lxy |
A list having two components representing real and imaginary parts |
x |
A matrix having two columns representing real and imaginary parts |
A real vector whose odd elements are the real part and whose even elements are the imaginary part of the complex vector
Nick Ellis, nick.ellis@csiro.au
re <- 1:10 im <- 10:1 z <- complex(real=re,imag=im) lis <- list(re,im) mat <- cbind(re,im) x1 <- C2R(z) x2 <- listxy2R(lis) x3 <- matrix2R(mat) all(x1==x2) all(x1==x3)