home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS2.DI$ / QRSC.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  379 b   |  20 lines

  1. % function t=qrsc(a)
  2. %   given an n x n matrix a, such that a'*a is real,
  3. %   this routine finds an upper triangular matrix t
  4. %   such that a'*a=t'*t.
  5.  
  6. function t=qrsc(a)
  7. [n,m]=size(a);
  8. temp=qr([real(a);imag(a)]);
  9. t=temp(1:n,1:n);
  10. if n>1,
  11.   for i=2:n,
  12.     for j=1:i-1,
  13.       t(i,j)=0.0;
  14.     end;
  15.   end;
  16. end;
  17.  
  18. %
  19. % Copyright MUSYN INC 1991,  All Rights Reserved
  20.