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. |
3402
|
18 |
3381
|
19 ## function [systype, nout, nin, ncstates, ndstates] = minfo(inmat) |
|
20 ## |
|
21 ## MINFO: Determines the type of system matrix. INMAT can be |
|
22 ## a varying(*), system, constant, and empty matrix. |
|
23 ## |
|
24 ## Returns: |
|
25 ## systype can be one of: |
|
26 ## varying, system, constant, and empty |
|
27 ## nout is the number of outputs of the system |
|
28 ## nin is the number of inputs of the system |
|
29 ## ncstates is the number of continuous states of the system |
|
30 ## ndstates is the number of discrete states of the system |
|
31 |
3398
|
32 ## Author: R. Bruce Tenison <btenison@eng.auburn.edu> |
|
33 ## Created: July 29, 1994 |
|
34 ## Modified by David Clem November 13, 1994 |
|
35 ## Modified by A. S. Hodel July 1995 |
3213
|
36 |
3398
|
37 function [systype, nout, nin, ncstates, ndstates] = minfo (inmat) |
3213
|
38 |
|
39 warning("minfo: obsolete. Use sys2ss, sys2tf, or sys2zp."); |
|
40 |
|
41 if (nargin ~= 1 ) |
3400
|
42 disp ("MINFO: Wrong number of arguments") |
3213
|
43 systype = nout = nin = ncstates = ndstates = []; |
|
44 endif |
|
45 |
|
46 [rr,cc] = size(inmat); |
|
47 |
3381
|
48 ## Check for empty matrix first! |
3213
|
49 if (isempty(inmat)) |
|
50 systype = "empty"; |
|
51 nout = nin = ncstates = ndstates = 0; |
|
52 return |
|
53 |
3381
|
54 ## Check for Constant matrix |
3213
|
55 |
|
56 elseif (rr == 1 || cc == 1) |
|
57 systype = "constant"; |
|
58 nout = nin = ncstates = ndstates = 1; |
|
59 return |
|
60 |
3381
|
61 ## Check for system type matrix |
3213
|
62 elseif (inmat(rr,cc) == -Inf) |
|
63 systype = "system"; |
|
64 ncstates = inmat(1,cc); |
|
65 ndstates = inmat(rr,1); |
|
66 nstates = ncstates + ndstates; |
|
67 nout = rr - nstates - 1; |
|
68 nin = cc - nstates - 1; |
|
69 |
3381
|
70 ## Check for Varying type matrix |
3213
|
71 elseif (inmat(rr,cc) == Inf) |
|
72 systype = "varying"; |
|
73 npoints = inmat(rr,cc-1); |
|
74 nin = cc - 1; |
|
75 nout = rr / npoints; |
|
76 nstates = 0; |
|
77 |
3381
|
78 ## Must be a standard matrix |
3213
|
79 else |
|
80 systype = "constant"; |
|
81 nin = cc; |
|
82 nout = rr; |
|
83 ncstates = 0; |
|
84 ndstates = 0; |
|
85 endif |
|
86 endfunction |