home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 7.ddi / ROBUST.DI$ / DCLXBODE.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.0 KB  |  34 lines

  1. function [g] = dclxbode(Z1,Z2,Z3,Z4,Z5,Z6,Z7)
  2. %
  3. % DBODE    Bode response of discrete-time linear systems.
  4. %
  5. % [G] = DCLXBODE(SS_,IU,W,TS) or
  6. % [G] = DCLXBODE(A,B,C,D,IU,W,TS)  calculates the frequency
  7. %       response of the system:
  8. %            x[n+1] = Ax[n] + Bu[n]                  -1
  9. %            y[n]   = Cx[n] + Du[n]         G(z) = C(zI-A) B + D
  10. %
  11. %    from the iu'th input.  Vector W must contain the frequencies, in
  12. %    radians, at which the Bode response is to be evaluated.  DBODE returns
  13. %       matrices MAG and PHASE (in degrees) with as many columns as there are 
  14. %       outputs y, and with LENGTH(W) rows.  
  15. %
  16.  
  17. % R. Y. Chiang & M. G. Safonov 6/23/87
  18. % Copyright (c) 1988 by the MathWorks, Inc.
  19. % All Rights Reserved.
  20. % ---------------------------------------------------------------------------
  21. %
  22.  
  23. inargs = '(a,b,c,d,iu,w,Ts)';
  24. eval(mkargs(inargs,nargin,'ss'))
  25.  
  26. [no,ns] = size(c);
  27. nw = max(size(w));
  28. b = b(:,iu);
  29. d = d(:,iu);
  30. w = exp(sqrt(-1) * w * Ts);
  31. g = ltifr(a,b,w);
  32. g = c * g + diag(d) * ones(no,nw);
  33. %
  34. % ------ End of DCLXBODE.M --- RYC/MGS 6/23/87 %