7017
|
1 ## Copyright (C) 1996, 2000, 2002, 2004, 2005, 2007 |
|
2 ## Auburn University. All rights reserved. |
3421
|
3 ## |
3426
|
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. |
3421
|
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. |
3426
|
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/>. |
3421
|
19 |
4771
|
20 ## O B S O L E T E: use ss instead. |
3421
|
21 ## function Asys = packsys(a,b,c[,d,dflg]) |
3426
|
22 ## |
3421
|
23 ## dflg: 0 for continuous time system, 1 for discrete-time system. |
3426
|
24 ## |
3421
|
25 ## defaults: |
|
26 ## D: 0 matrix of appropriate dimension. |
|
27 ## dflg: 0 (continuous time) |
3426
|
28 ## |
3421
|
29 ## Note: discrete-state sampling time is not included! |
|
30 |
|
31 ## Author: R. Bruce Tenison <btenison@eng.auburn.edu> |
|
32 ## Created: July 29, 1994 |
|
33 ## Modified by David Clem November 13, 1994 |
|
34 ## Modified by A. S. Hodel April 1995 |
|
35 |
|
36 function Asys = packsys (a, b, c, d, dflg) |
|
37 |
4771
|
38 warning("packsys is obsolete! Use ss instead."); |
3426
|
39 |
3421
|
40 if (nargin < 3 || nargin > 5) |
7134
|
41 disp ("packsys: Invalid number of arguments"); |
3421
|
42 endif |
|
43 |
|
44 ## check dflg |
7134
|
45 if (nargin == 5) |
|
46 if (! isscalar (dflg)) |
|
47 [m, n] = size(dflg); |
|
48 error (["packsys: dflg (%d,%d) must be a scalar", m, n); |
|
49 elseif (dflg != 0 && dflg != 1) |
|
50 error ("packsys: dflg=%g must be 0 or 1", dflg); |
3421
|
51 endif |
|
52 else |
|
53 ## default condition |
|
54 dflg = 0; |
|
55 endif |
|
56 |
|
57 if (nargin == 3) |
|
58 ## No D matrix. Form a zero one! |
7134
|
59 [brows, bcols] = size (b); |
|
60 [crows, ccols] = size (c); |
|
61 d = zeros (crows, bcols); |
3421
|
62 endif |
|
63 |
7134
|
64 [n, m, p] = abcddim (a, b, c, d); |
3421
|
65 if (n == -1 || m == -1 || p == -1) |
7134
|
66 error ("packsys: incompatible dimensions") |
3421
|
67 endif |
3426
|
68 |
7134
|
69 Asys = ss (a, b, c, d, dflg); |
3421
|
70 |
|
71 endfunction |