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

  1. function [G,PV] = trfss(th,nnu,nny,w)
  2. %TRFSS    Auxiliary routine to TRF
  3. %
  4. %    [G,PV] = trfss(th,nnu,nny,w)
  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. lny=length(nny);
  18. if length(nnu)>0
  19. G=[];G1=zeros(1+length(w),3*lny);
  20. for ku=nnu
  21. if ku>0, [g,p]=trfsaux(a,b,c(nny,:),d(nny,:),ku,w,T); 
  22. G1(1,1:3:3*lny)=1000*(nny-1)+100+ku;
  23. G1(1,2:3:3*lny)=1000*(nny-1)+ku;
  24. G1(1,3:3:3*lny)=1000*(nny-1)+20+ku;
  25. G1(2:length(w)+1,[1:3:3*lny 2:3:3*lny 3:3:3*lny])=[w'*ones(1,length(nny)) g p];
  26. G=[G G1];
  27. end ,end,end
  28. if nargout>1 | nu==0
  29. PV=[]; [par,PM,lam]=th2par(th);
  30. for ky=nny
  31.     g=trfsaux(a,k,c(ky,:),ones(1,ny),ky,w,T);
  32. PV1(1,1:2)=[(ky-1)*1000+100,(ky-1)*1000];
  33. PV1(2:length(w)+1,[1:2])=[w' abs(T)*(abs(g).^2)*lam(ky,ky)];    
  34. PV=[PV PV1];
  35. end
  36. end
  37. if nu==0 G=PV;
  38. end