3421
|
1 ## Copyright (C) 1996 Auburn University. All rights reserved. |
|
2 ## |
3426
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
3421
|
9 ## |
7016
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
3426
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
3421
|
18 |
4771
|
19 ## O B S O L E T E: use ss instead. |
3421
|
20 ## function Asys = packsys(a,b,c[,d,dflg]) |
3426
|
21 ## |
3421
|
22 ## dflg: 0 for continuous time system, 1 for discrete-time system. |
3426
|
23 ## |
3421
|
24 ## defaults: |
|
25 ## D: 0 matrix of appropriate dimension. |
|
26 ## dflg: 0 (continuous time) |
3426
|
27 ## |
3421
|
28 ## Note: discrete-state sampling time is not included! |
|
29 |
|
30 ## Author: R. Bruce Tenison <btenison@eng.auburn.edu> |
|
31 ## Created: July 29, 1994 |
|
32 ## Modified by David Clem November 13, 1994 |
|
33 ## Modified by A. S. Hodel April 1995 |
|
34 |
|
35 function Asys = packsys (a, b, c, d, dflg) |
|
36 |
4771
|
37 warning("packsys is obsolete! Use ss instead."); |
3426
|
38 |
3421
|
39 if (nargin < 3 || nargin > 5) |
|
40 disp("packsys: Invalid number of arguments") |
|
41 endif |
|
42 |
|
43 ## check dflg |
|
44 if(nargin == 5) |
4030
|
45 if( !isscalar(dflg)) |
3421
|
46 [m,n] = size(dflg); |
|
47 error(["packsys: dflg (",num2str(m),",",num2str(n), ... |
3426
|
48 ") must be a scalar."]); |
3421
|
49 elseif( (dflg != 0) && (dflg != 1)) |
|
50 error(["packsys: dflg=",num2str(dflg),"must be 0 or 1"]); |
|
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! |
|
59 [brows,bcols] = size(b); |
|
60 [crows,ccols] = size(c); |
|
61 d = zeros(crows,bcols); |
|
62 endif |
|
63 |
|
64 [n,m,p] = abcddim(a,b,c,d); |
|
65 if (n == -1 || m == -1 || p == -1) |
|
66 error("packsys: incompatible dimensions") |
|
67 endif |
3426
|
68 |
4771
|
69 Asys = ss(a,b,c,d,dflg); |
3421
|
70 |
|
71 endfunction |