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

  1. function [G,PV] = trfsssd(th,nnu,nny,w)
  2. %TRFSSSD    Auxiliary routine to TH2FF
  3. %
  4. %    [G,PHI]=trfsssd(th)
  5. %
  6.  
  7. %    L. Ljung 10-2-90
  8. %    Copyright (c) 1990 by the MathWorks, Inc.
  9. %    All Rights Reserved.
  10.  
  11. [a,b,c,d,k]=eta2ss(th); [nx,nu]=size(b);[ny,nx]=size(c);
  12. if any(nnu>nu),error('There are not that many inputs in the model!'),end
  13. if any(nny>ny),error('There are not that many outputs in the model!'),end
  14. T=gett(th);
  15. if isempty(nnu),nnu=1:nu;end
  16. if isempty(nny),nny=1:ny;end
  17. if length(nnu)==1,if nnu<0,nnu=1:nu;end,end
  18. if length(nny)==1,if nny<0,nny=1:ny;end,end
  19. lny=length(nny);
  20.  
  21. G=[];PV=[];
  22. for ky=nny
  23.     thbb=thss2th(th,ky);
  24.     if nargout==1 , gy=th2ff(thbb,nnu,w);else [gy,pvy]=th2ff(thbb,nnu,w);
  25.        pvy(1,:)=pvy(1,:)+(ky-1)*1000; PV=[PV pvy];
  26.     end
  27.     gy(1,:)=gy(1,:)+(ky-1)*1000;G=[G gy]; 
  28. end
  29. if nu==0,PV=G;end
  30. if length(nnu)>0
  31.      for ku=nnu
  32.     [g,p]=trfsaux(a,b,c(nny,:),d(nny,:),ku,w,T); 
  33.         scount=1;
  34.     for ky=nny
  35.       G(2:length(w)+1,find(G(1,:)==1000*(ky-1)+ku))=g(:,scount);
  36.       G(2:length(w)+1,find(G(1,:)==1000*(ky-1)+20+ku))=p(:,scount);
  37.       scount=scount+1;
  38.         end
  39.      end
  40. end
  41.  
  42. if nargout>1 | nu==0
  43.     [par,PM,lam]=th2par(th);
  44.     for ky=nny
  45.        g=trfsaux(a,k,c(ky,:),ones(1,ny),ky,w,T);
  46.        PV(2:length(w)+1,find(PV(1,:)==1000*(ky-1)))=abs(T)*(g.^2)*lam(ky,ky);
  47.     end
  48. end
  49. if nu==0 G=PV;end
  50.