home *** CD-ROM | disk | FTP | other *** search
- function [w,amp,phas,sdamp,sdphas] = getff(g,nu,ny)
- %GETFF Selects the frequency function (for own plotting)
- %
- % [W,AMP,PHAS] = getff(G,NU,NY)
- %
- % W: The frequency scale in radians/second
- % AMP: The amplitude function
- % PHAS: The phase function (in degrees)
- % G: The frequency function in the FREQFUNC format. See HELP FREQFUNC
- % NU: The input number (noise input is counted as input # 0)
- % (Default 1. If G contains all spectra, then default is 0)
- % NY: The output number (default 1)
- %
- % If several entries in G correspond to the same input-output relation
- % W, AMP and PHAS will have the corresponding number of columns.
- %
- % The standard deviation of the amplitude and the standard deviation of
- % the phase are obtained by
- %
- % [W,AMP,PHAS,SD_AMP,SD_PHAS] = getff(G,NU,NY)
-
- % L. Ljung 10-2-90
- % Copyright (c) 1990 by the MathWorks, Inc.
- % All Rights Reserved.
-
- if nargin<3, ny=1;end
- if isempty(ny), ny=1;end
- if nargin<2, nu=1;end, if isempty(nu), nu=1;end
- [rg,cg]=size(g);
- info=g(1,:);
- if all(rem(info,10)==0), %then all G contain spectral information
- nu=0;end
- w=g(2:rg,find(info==(ny-1)*1000+100+nu));
- amp=g(2:rg,find(info==(ny-1)*1000+nu));
- sdamp=g(2:rg,find(info==(ny-1)*1000+50+nu));
- phas=g(2:rg,find(info==(ny-1)*1000+20+nu));
- sdphas=g(2:rg,find(info==(ny-1)*1000+70+nu));
-
-