3437
|
1 ## Copyright (C) 1996, 1998 Auburn University. All rights reserved. |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by the |
|
7 ## Free Software Foundation; either version 2, or (at your option) any |
|
8 ## later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ## for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
5307
|
17 ## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
18 ## 02110-1301 USA. |
3437
|
19 |
6945
|
20 ## Undocumented internal function. |
|
21 |
3437
|
22 ## -*- texinfo -*- |
3500
|
23 ## @deftypefn {Function File} {} __outlist__ (@var{lmat}, @var{tabchar}, @var{yd}, @var{ilist}) |
3437
|
24 ## Prints an enumerated list of strings. |
|
25 ## internal use only; minimal argument checking performed |
|
26 ## |
|
27 ## @strong{Inputs} |
|
28 ## @table @var |
|
29 ## @item lmat |
|
30 ## list of strings |
|
31 ## @item tabchar |
|
32 ## tab character (default: none) |
|
33 ## @item yd |
|
34 ## indices of strings to append with the string "(discrete)" |
|
35 ## (used by @var{sysout}; minimal checking of this argument) |
3500
|
36 ## @math{yd = []} indicates all outputs are continuous |
3437
|
37 ## @item ilist |
|
38 ## index numbers to print with names. |
|
39 ## |
|
40 ## default: @code{1:rows(lmat)} |
|
41 ## @end table |
|
42 ## |
|
43 ## @strong{Outputs} |
|
44 ## prints the list to the screen, numbering each string in order. |
|
45 ## @end deftypefn |
|
46 |
|
47 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
48 ## Created: December 1995 |
|
49 |
3438
|
50 function str_val = __outlist__ (name_list, tabchar, yd, ilist) |
3437
|
51 |
5568
|
52 if( nargin < 1 | nargin > 4 ) |
6046
|
53 print_usage (); |
5568
|
54 endif |
3437
|
55 |
5568
|
56 m = length(name_list); |
|
57 if(nargin < 4) |
|
58 ilist = 1:m; |
|
59 endif |
|
60 if(nargin ==1) |
|
61 tabchar = ""; |
|
62 endif |
3437
|
63 |
5568
|
64 if(nargin < 3) |
|
65 yd = zeros(1,m); |
|
66 elseif(isempty(yd)) |
|
67 yd = zeros(1,m); |
|
68 endif |
3437
|
69 |
5568
|
70 str_val = ""; |
|
71 dstr = {""," (discrete)"}; |
|
72 if((m >= 1) && (iscell(name_list))) |
|
73 for ii=1:m |
4460
|
74 str_val = sprintf("%s%s%d: %s%s\n",str_val,tabchar, ilist(ii), ... |
4771
|
75 name_list{ii},dstr{yd(ii)+1}); |
5568
|
76 endfor |
|
77 else |
|
78 str_val = sprintf("%sNone",tabchar); |
|
79 endif |
3437
|
80 |
|
81 endfunction |