home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 9.ddi / IDENT.DI$ / GETFF.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.3 KB  |  39 lines

  1. function [w,amp,phas,sdamp,sdphas] = getff(g,nu,ny)
  2. %GETFF    Selects the frequency function (for own plotting)
  3. %
  4. %    [W,AMP,PHAS] = getff(G,NU,NY)
  5. %
  6. %    W: The frequency scale in radians/second
  7. %    AMP: The amplitude function
  8. %    PHAS: The phase function (in degrees)
  9. %    G: The frequency function in the FREQFUNC format. See HELP FREQFUNC
  10. %    NU: The input number (noise input is counted as input # 0)
  11. %        (Default 1. If G contains all spectra, then default is 0)        
  12. %    NY: The output number (default 1)
  13. %
  14. %    If several entries in G correspond to the same input-output relation
  15. %    W, AMP and PHAS will have the corresponding number of columns.
  16. %
  17. %    The standard deviation of the amplitude and the standard deviation of
  18. %    the phase are obtained by
  19. %
  20. %    [W,AMP,PHAS,SD_AMP,SD_PHAS] = getff(G,NU,NY)
  21.  
  22. %    L. Ljung 10-2-90
  23. %    Copyright (c) 1990 by the MathWorks, Inc.
  24. %    All Rights Reserved.
  25.  
  26. if nargin<3, ny=1;end
  27. if isempty(ny), ny=1;end
  28. if nargin<2, nu=1;end, if isempty(nu), nu=1;end
  29. [rg,cg]=size(g);
  30. info=g(1,:);
  31. if all(rem(info,10)==0), %then all G contain spectral information
  32. nu=0;end
  33.     w=g(2:rg,find(info==(ny-1)*1000+100+nu));
  34.     amp=g(2:rg,find(info==(ny-1)*1000+nu));
  35.     sdamp=g(2:rg,find(info==(ny-1)*1000+50+nu));
  36.     phas=g(2:rg,find(info==(ny-1)*1000+20+nu)); 
  37.     sdphas=g(2:rg,find(info==(ny-1)*1000+70+nu));
  38.  
  39.