3381
|
1 ## Copyright (C) 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 |
|
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
3346
|
18 |
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File } { @var{systype} =} sysgettype ( @var{sys} ) |
|
21 ## return the initial system type of the system |
|
22 ## |
|
23 ## @strong{Inputs} |
|
24 ## @var{sys}: system data structure |
|
25 ## |
|
26 ## @strong{Outputs} |
|
27 ## @var{systype}: string indicating how the structure was initially |
|
28 ## constructed: |
|
29 ## values: @code{"ss"}, @code{"zp"}, or @code{"tf"} |
|
30 ## |
|
31 ## @strong{Note} FIR initialized systems return @code{systype="tf"}. |
|
32 ## |
|
33 ## |
|
34 ## @end deftypefn |
|
35 |
3213
|
36 function systype = sysgettype(sys) |
|
37 |
|
38 if(!is_struct(sys)) |
|
39 error("sysgettype: input sys is not a structure"); |
|
40 endif |
|
41 |
3228
|
42 typestr = list("tf","zp","ss"); |
|
43 systype = nth(typestr,sys.sys(1) + 1); |
3213
|
44 endfunction |