Mercurial > octave-nkf
comparison scripts/control/system/__sysdefioname__.m @ 7136:59dcf01bb3e3
[project @ 2007-11-08 20:18:25 by jwe]
author | jwe |
---|---|
date | Thu, 08 Nov 2007 20:18:26 +0000 |
parents | a1dbe9d80eee |
children |
comparison
equal
deleted
inserted
replaced
7135:8aa770b6c5bf | 7136:59dcf01bb3e3 |
---|---|
39 ## @end example | 39 ## @end example |
40 ## @end deftypefn | 40 ## @end deftypefn |
41 | 41 |
42 function ioname = __sysdefioname__ (n, str, m) | 42 function ioname = __sysdefioname__ (n, str, m) |
43 | 43 |
44 if (nargin < 2 | nargin > 3) | 44 if (nargin < 2 || nargin > 3) |
45 print_usage (); | 45 print_usage (); |
46 endif | 46 endif |
47 | 47 |
48 if (nargin == 2) m = min(1,n); endif | 48 if (nargin == 2) |
49 m = min (1, n); | |
50 endif | |
49 | 51 |
50 ioname = {}; | 52 ioname = {}; |
51 jj = 1; | 53 jj = 1; |
52 if(n > 0 & m > 0 & m <= n) | 54 if (n > 0 && m > 0 && m <= n) |
53 for ii = m:n | 55 for ii = m:n |
54 ioname{ii+1-m} = sprintf("%s_%d",str,ii); | 56 ioname{ii+1-m} = sprintf ("%s_%d", str, ii); |
55 endfor | 57 endfor |
56 elseif(m > n) | 58 elseif (m > n) |
57 error("str=%s; start value m=%d > final value n=%d",str,m,n); | 59 error ("str=%s; start value m=%d > final value n=%d", str, m, n); |
58 endif | 60 endif |
59 | 61 |
60 endfunction | 62 endfunction |