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