annotate scripts/control/util/__outlist__.m @ 6945:6bbf56a9718a

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