7017
|
1 ## Copyright (C) 1996, 1998, 2000, 2005, 2007 |
|
2 ## Auburn University. All rights reserved. |
3437
|
3 ## |
|
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. |
3437
|
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. |
3437
|
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/>. |
3437
|
19 |
6945
|
20 ## Undocumented internal function. |
|
21 |
3437
|
22 ## -*- texinfo -*- |
3438
|
23 ## @deftypefn {Function File} {[@var{n_tot}, @var{st_c}, @var{st_d}, @var{y_c}, @var{y_d}] =} __syscont_disc__ (@var{sys}) |
3437
|
24 ## Used internally in syscont and sysdisc. |
|
25 ## |
|
26 ## @strong{Inputs} |
3500
|
27 ## @var{sys} is a system data structure. |
3437
|
28 ## |
|
29 ## @strong{Outputs} |
|
30 ## @table @var |
|
31 ## @item n_tot |
|
32 ## total number of states |
|
33 ## @item st_c |
|
34 ## vector of continuous state indices (empty if none) |
|
35 ## @item st_d |
|
36 ## vector of discrete state indices (empty if none) |
|
37 ## @item y_c |
|
38 ## vector of continuous output indices |
|
39 ## @item y_d |
|
40 ## vector of discrete output indices |
|
41 ## @end table |
|
42 ## @end deftypefn |
|
43 |
|
44 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
45 ## Created: February 1997 |
|
46 |
3438
|
47 function [n_tot, st_c, st_d, y_c, y_d] = __syscont_disc__ (sys) |
3437
|
48 |
|
49 ## get ranges for discrete/continuous states and outputs |
7136
|
50 [nn, nz, mm, pp, yd] = sysdimensions (sys); |
3437
|
51 n_tot = nn + nz; |
|
52 st_c = 1:(nn); |
|
53 st_d = nn + (1:nz); |
7136
|
54 y_c = find (yd == 0); # y_c, y_d will be empty if there are none. |
|
55 y_d = find (yd == 1); |
3437
|
56 |
|
57 endfunction |