3430
|
1 ## Copyright (C) 1996 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. |
|
18 |
|
19 ## -*- texinfo -*- |
|
20 ##@deftypefn {Function File} {[@var{zer}, @var{pol}, @var{k}, @var{tsam}, @var{inname}, @var{outname}] =} sys2zp (@var{sys}) |
|
21 ## Extract zero/pole/leading coefficient information from a system data |
5016
|
22 ## structure. |
3430
|
23 ## |
5016
|
24 ## See @command{zp} for parameter descriptions. |
3430
|
25 ## |
|
26 ## @strong{Example} |
|
27 ## @example |
4771
|
28 ## octave:1> sys=ss([1 -2; -1.1,-2.1],[0;1],[1 1]); |
3430
|
29 ## octave:2> [zer,pol,k] = sys2zp(sys) |
|
30 ## zer = 3.0000 |
|
31 ## pol = |
|
32 ## -2.6953 |
|
33 ## 1.5953 |
|
34 ## k = 1 |
|
35 ## @end example |
|
36 ## @end deftypefn |
|
37 |
|
38 ## Author: John Ingram <ingraje@eng.auburn.edu> |
|
39 ## Created: July 15, 1996 |
|
40 |
|
41 function [zer, pol, k, tsam, inname, outname] = sys2zp (sys) |
|
42 |
|
43 if(nargin != 1) |
|
44 usage("[zer,pol,k,tsam,inname,outname] = sys2zp(sys)"); |
4030
|
45 elseif( !isstruct(sys)) |
3430
|
46 error("sysconnect: sys must be in system data structure form") |
|
47 elseif (! is_siso(sys) ) |
|
48 [n, nz, m, p] = sysdimensions(sys); |
|
49 error(["system is not SISO (",num2str(m)," inputs, ... |
|
50 ", num2str(p)," outputs"]); |
|
51 endif |
|
52 |
|
53 ## update zero-pole form |
|
54 sys = sysupdate(sys,"zp"); |
|
55 |
|
56 zer = sys.zer; |
|
57 pol = sys.pol; |
|
58 k = sys.k; |
|
59 tsam = sysgettsam(sys); |
|
60 inname = sysgetsignals(sys,"in"); |
|
61 outname = sysgetsignals(sys,"out"); |
|
62 |
|
63 endfunction |
|
64 |
|
65 |