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