7017
|
1 ## Copyright (C) 1998, 2000, 2002, 2003, 2004, 2005, 2007 |
|
2 ## Auburn University. All rights reserved. |
3430
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
7 ## under the terms of the GNU General Public License as published by |
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
3430
|
10 ## |
7016
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
3430
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
3430
|
19 |
|
20 ## -*- texinfo -*- |
3500
|
21 ## @deftypefn {Function File} {} sysgettype (@var{sys}) |
3430
|
22 ## return the initial system type of the system |
|
23 ## |
5016
|
24 ## @strong{Input} |
|
25 ## @table @var |
|
26 ## @item sys |
|
27 ## System data structure. |
|
28 ## @end table |
3430
|
29 ## |
5016
|
30 ## @strong{Output} |
|
31 ## @table @var |
|
32 ## @item systype |
|
33 ## String indicating how the structure was initially |
|
34 ## constructed. Values: @code{"ss"}, @code{"zp"}, or @code{"tf"}. |
|
35 ## @end table |
3430
|
36 ## |
5016
|
37 ## @acronym{FIR} initialized systems return @code{systype="tf"}. |
3430
|
38 ## @end deftypefn |
|
39 |
|
40 function systype = sysgettype (sys) |
|
41 |
7125
|
42 if (nargin != 1) |
|
43 print_usage (); |
|
44 endif |
|
45 |
4462
|
46 if (! isstruct (sys)) |
|
47 error ("sysgettype: input sys is not a structure"); |
3430
|
48 endif |
|
49 |
4771
|
50 typestr = {"tf", "zp", "ss"}; |
7125
|
51 systype = typestr{sys.sys(1) + 1}; |
4462
|
52 |
3430
|
53 endfunction |