function [v,d] = cjf2rjf(v,d) % %CJF2RJF Function [v,d] = cjf2rjf(v,d) transformes a complex % Jordan form into a real Jordan form. The inputs are % the eigenvalue-matrix d and the eigenvector-matrix v, % resulting from the program eig.m. % version 1.0 13 jan 1987 M. Steinbuch % N.V.KEMA & Delft Univ. of Tech. im=sqrt(-1); n=length(d); t=eye(n) + im*zeros(n); k=0; for i=1:(n-1) if imag(d(i,i))~=0 if k==0 t(i,i+1)=1; t(i+1,i)=im; t(i+1,i+1)=-im; k=1; else k=0; end end end v=v/t; d=t*d/t;