Next: ctranspose() Up: Mathematical Macros Help File Previous: csubscr()   Contents

ctrace()

Usage:
b <- ctrace(a), REAL matrix a interpreted as a square complex matrix in
  fully complex form.



Keywords: complex matrices, matrices
                                  Usage
c <- ctrace(a) computes the complex trace of REAL matrix a, interpreted
as a square complex matrix A in fully complex form.  c has value
cmplx(trace(creal(a)),trace(cimag(a))).  For A to be squre, nrows(a)
must be floor((ncols(a)+1)/2).'

Example:
  Cmd> areal <- matrix(vector(0.57,-0.24,-0.33,-0.55),2)

  Cmd> aimag <- matrix(vector(0.43,-0.08,-0.16,0.26),2)

  Cmd> ctrace(cmplx(areal,aimag))
  (1,1)        0.02        0.69

  Cmd> cmplx(trace(areal),trace(aimag)) # check
  (1,1)        0.02        0.69

                            Cross references
See also trace(), cmplx(), 'complex'.


Gary Oehlert 2006-01-30