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

  1. function cmd=mkargs(s,n,f)
  2. % CMD=mkargs(TEMP,N,F) is used inside functions for expanding an input
  3. %     argument list which includes systems (as created by MKSYS)
  4. %     and inserting the system matrices in the place of each system.
  5. %     Typical usage involves modifying the list of input arguments in
  6. %     the function definition line to be of the form Z1,Z2,Z3,...,ZN, then
  7. %     inserting two lines immediately after the modified function definition
  8. %     line.   For example,
  9. %            function [x,y,z] = foo(a,b,c)
  10. %     would be replaced by
  11. %            function [x,y,z] = foo(Z1,Z2,Z3)
  12. %            inargs='(a,b,c)';
  13. %            eval(mkargs(inargs,nargin))
  14. %     The optional string TY, if present, specifies the admissible system
  15. %     types for the systems to be encountered in the order in which they
  16. %     are expected, e.g., TY='ss,tss'.
  17. %
  18. %     CAVEAT:  Due to a bug in the way some versions of Matlab handle
  19. %     the EVAL function, it is critical that the string INARGS not
  20. %     include the names Z1,Z2,etc. in the string INARGS.
  21.  
  22.  
  23. if nargin<3,f='';end
  24. inarglist=s(find(s=='(')+1:find(s==')')-1);
  25. x1='Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10,Z11,Z12,Z13,Z14,Z15,Z16,Z17,Z18,Z19,Z20';
  26. x2='Z21,Z22,Z23,Z24,Z25,Z26,Z27,Z28,Z29,Z30,Z31,Z32,Z33,Z34,Z35,Z36,';
  27. x3='Z37,Z38,Z39,Z40,Z41,Z42,Z43,Z44,Z45,Z46,Z47,Z48,Z49,Z50,';
  28. inarglist1=[x1 x2 x3];
  29. ind=find(inarglist1==',');
  30. inarglist1=inarglist1(1:ind(n)-1);
  31. cmd = ['[xsflag,nargin,' inarglist ']=mkargs1(''' f ''',' inarglist1 ');' ];
  32. %
  33.  
  34.  
  35.