annotate scripts/control/minfo.m @ 3408:ae7adbb591e8

[project @ 2000-01-06 08:29:11 by jwe]
author jwe
date Thu, 06 Jan 2000 08:29:26 +0000
parents 9610d364e444
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3397
1a8e2c0d627a [project @ 1999-12-18 03:02:18 by jwe]
jwe
parents: 3385
diff changeset
1 ## Copyright (C) 1996 Auburn University. All rights reserved.
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
2 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
3 ## This file is part of Octave.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
4 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
6 ## under the terms of the GNU General Public License as published by the
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
7 ## Free Software Foundation; either version 2, or (at your option) any
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
8 ## later version.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
9 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
13 ## for more details.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
14 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
15 ## You should have received a copy of the GNU General Public License
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
16 ## along with Octave; see the file COPYING. If not, write to the Free
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
3402
9610d364e444 [project @ 2000-01-05 04:36:38 by jwe]
jwe
parents: 3400
diff changeset
18
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
19 ## function [systype, nout, nin, ncstates, ndstates] = minfo(inmat)
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
20 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
21 ## MINFO: Determines the type of system matrix. INMAT can be
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
22 ## a varying(*), system, constant, and empty matrix.
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
23 ##
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
24 ## Returns:
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
25 ## systype can be one of:
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
26 ## varying, system, constant, and empty
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
27 ## nout is the number of outputs of the system
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
28 ## nin is the number of inputs of the system
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
29 ## ncstates is the number of continuous states of the system
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
30 ## ndstates is the number of discrete states of the system
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
31
3398
0f515bc98460 [project @ 1999-12-18 04:21:28 by jwe]
jwe
parents: 3397
diff changeset
32 ## Author: R. Bruce Tenison <btenison@eng.auburn.edu>
0f515bc98460 [project @ 1999-12-18 04:21:28 by jwe]
jwe
parents: 3397
diff changeset
33 ## Created: July 29, 1994
0f515bc98460 [project @ 1999-12-18 04:21:28 by jwe]
jwe
parents: 3397
diff changeset
34 ## Modified by David Clem November 13, 1994
0f515bc98460 [project @ 1999-12-18 04:21:28 by jwe]
jwe
parents: 3397
diff changeset
35 ## Modified by A. S. Hodel July 1995
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
36
3398
0f515bc98460 [project @ 1999-12-18 04:21:28 by jwe]
jwe
parents: 3397
diff changeset
37 function [systype, nout, nin, ncstates, ndstates] = minfo (inmat)
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
38
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
39 warning("minfo: obsolete. Use sys2ss, sys2tf, or sys2zp.");
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
40
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
41 if (nargin ~= 1 )
3400
18366d37e7dd [project @ 1999-12-22 23:36:09 by jwe]
jwe
parents: 3398
diff changeset
42 disp ("MINFO: Wrong number of arguments")
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
43 systype = nout = nin = ncstates = ndstates = [];
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
44 endif
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
45
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
46 [rr,cc] = size(inmat);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
47
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
48 ## Check for empty matrix first!
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
49 if (isempty(inmat))
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
50 systype = "empty";
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
51 nout = nin = ncstates = ndstates = 0;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
52 return
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
53
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
54 ## Check for Constant matrix
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
55
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
56 elseif (rr == 1 || cc == 1)
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
57 systype = "constant";
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
58 nout = nin = ncstates = ndstates = 1;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
59 return
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
60
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
61 ## Check for system type matrix
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
62 elseif (inmat(rr,cc) == -Inf)
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
63 systype = "system";
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
64 ncstates = inmat(1,cc);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
65 ndstates = inmat(rr,1);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
66 nstates = ncstates + ndstates;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
67 nout = rr - nstates - 1;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
68 nin = cc - nstates - 1;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
69
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
70 ## Check for Varying type matrix
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
71 elseif (inmat(rr,cc) == Inf)
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
72 systype = "varying";
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
73 npoints = inmat(rr,cc-1);
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
74 nin = cc - 1;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
75 nout = rr / npoints;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
76 nstates = 0;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
77
3381
69b167451491 [project @ 1999-12-15 20:48:10 by jwe]
jwe
parents: 3284
diff changeset
78 ## Must be a standard matrix
3213
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
79 else
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
80 systype = "constant";
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
81 nin = cc;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
82 nout = rr;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
83 ncstates = 0;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
84 ndstates = 0;
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
85 endif
ba1c7cdc6090 [project @ 1998-11-06 16:15:36 by jwe]
jwe
parents:
diff changeset
86 endfunction