3397
|
1 ## Copyright (C) 1996 Auburn University. All rights reserved. |
3381
|
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{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 |
|
22 ## structure |
|
23 ## |
|
24 ## See @ref{zp2sys} for parameter descriptions. |
|
25 ## |
|
26 ## @strong{Example} |
|
27 ## @example |
|
28 ## octave:1> sys=ss2sys([1 -2; -1.1,-2.1],[0;1],[1 1]); |
|
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 |
3213
|
37 |
3398
|
38 ## Author: John Ingram <ingraje@eng.auburn.edu> |
|
39 ## Created: July 15, 1996 |
3381
|
40 |
3398
|
41 function [zer, pol, k, tsam, inname, outname] = sys2zp (sys) |
3213
|
42 |
|
43 if(nargin != 1) |
|
44 usage("[zer,pol,k,tsam,inname,outname] = sys2zp(sys)"); |
|
45 elseif( !is_struct(sys)) |
|
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 |
3381
|
53 ## update zero-pole form |
3213
|
54 sys = sysupdate(sys,"zp"); |
|
55 |
|
56 zer = sys.zer; |
|
57 pol = sys.pol; |
|
58 k = sys.k; |
3228
|
59 tsam = sysgettsam(sys); |
|
60 inname = sysgetsignals(sys,"in"); |
|
61 outname = sysgetsignals(sys,"out"); |
3213
|
62 |
|
63 endfunction |
|
64 |
|
65 |