home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / MATFUN.DI$ / CDF2RDF.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  769 b   |  23 lines

  1. function [vv,dd] = cdf2rdf(v,d)
  2. %CDF2RDF Complex diagonal form to real block diagonal form.
  3. %    [V,D] = CDF2RDF(V,D) transforms the outputs of EIG from complex
  4. %    diagonal form to a real diagonal form.  In complex diagonal form,
  5. %    D has complex eigenvalues down the diagonal.  In real diagonal
  6. %    form, the complex eigenvalues are in 2-by-2 blocks on the
  7. %    diagonal.  Complex eigenvalue pairs are assumed to be next
  8. %    to one another.
  9.  
  10. %    J.N. Little 4-27-87
  11. %    Based upon M-file from M. Steinbuch, N.V.KEMA & Delft Univ. of Tech.
  12. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  13.  
  14. j = sqrt(-1);
  15. t = eye(length(d));
  16. twobytwo = [1 1;j -j];
  17. i = find(imag(diag(d))');
  18. index = i(1:2:length(i));
  19. for i=index
  20.     t(i:i+1,i:i+1) = twobytwo;
  21. end    
  22. vv=v/t; dd=t*d/t;
  23.