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

  1. function [u,s,zero] = housh(u,j,heps)
  2. %HOUSH    Construct a householder transformation H=I-s*UU'.  Used in TZERO.
  3. %    
  4. %    [U,S,ZERO] = HOUSH(U,J,Heps)
  5.  
  6. %    Clay M. Thompson  7-23-90
  7. %    Copyright (c) 1986-93 by the MathWorks, Inc.
  8.  
  9. %  Constructs a Householder transformation H=I-s*UU' that 'mirrors' a 
  10. %  vector u to the Jth unit vector.  If NORM(U)<Eps then Zero=1 [True]
  11. %
  12. % Reference: Adapted from "Computation of Zeros of Linear Multivariable
  13. %            Systems", A. Emami-Naeini, and P. Van Dooren; Automatica
  14. %            Vol. 18, No. 4, pp. 415-430, 1982.
  15.  
  16.   s = sum(u.*u);
  17.   alfa = sqrt(s);
  18.   if (alfa<=heps), zero=1; return, end
  19.  
  20.   zero=0;
  21.   dum = u(j);
  22.   if dum>0, alfa=-alfa; end
  23.   u(j) = u(j)-alfa;
  24.   s = 1 ./(s-alfa*dum);
  25.  
  26.   u = u(:);    % Make u a column vector.
  27.  
  28.  
  29.