comparison scripts/control/system/__sysdefioname__.m @ 4771:b8105302cfe8

[project @ 2004-02-16 17:45:50 by jwe]
author jwe
date Mon, 16 Feb 2004 17:45:50 +0000
parents 7923abdeb4e5
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
4770:ef5e598f099b 4771:b8105302cfe8
23 ## is start value 23 ## is start value
24 ## 24 ##
25 ## used internally, minimal argument checking 25 ## used internally, minimal argument checking
26 ## 26 ##
27 ## @strong{Example} @code{ioname = __sysdefioname__(5,"u",3)} 27 ## @strong{Example} @code{ioname = __sysdefioname__(5,"u",3)}
28 ## returns the list: 28 ## returns the cell array:
29 ## @example 29 ## @example
30 ## ioname = 30 ## ioname =
31 ## ( 31 ## (
32 ## [1] = u_3 32 ## [1] = u_3
33 ## [2] = u_4 33 ## [2] = u_4
42 usage ("ioname = __sysdefioname__ (n, str, m)"); 42 usage ("ioname = __sysdefioname__ (n, str, m)");
43 endif 43 endif
44 44
45 if (nargin == 2) m = min(1,n); endif 45 if (nargin == 2) m = min(1,n); endif
46 46
47 ioname = list(); 47 ioname = {};
48 jj = 1; 48 jj = 1;
49 if(n > 0 & m > 0 & m <= n) 49 if(n > 0 & m > 0 & m <= n)
50 for ii = m:n 50 for ii = m:n
51 ioname(ii+1-m) = sprintf("%s_%d",str,ii); 51 ioname{ii+1-m} = sprintf("%s_%d",str,ii);
52 endfor 52 endfor
53 elseif(m > n) 53 elseif(m > n)
54 error("str=%s; start value m=%d > final value n=%d",str,m,n); 54 error("str=%s; start value m=%d > final value n=%d",str,m,n);
55 endif 55 endif
56 56