7017
|
1 ## Copyright (C) 1993, 1994, 1995, 2000, 2002, 2004, 2005, 2006, 2007 |
|
2 ## Auburn University. All rights reserved. |
3441
|
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. |
3441
|
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. |
3441
|
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/>. |
3441
|
19 |
|
20 ## -*- texinfo -*- |
3502
|
21 ## @deftypefn {Function File} {[@var{retval}, @var{u}] =} is_observable (@var{a}, @var{c}, @var{tol}) |
|
22 ## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} is_observable (@var{sys}, @var{tol}) |
3441
|
23 ## Logical check for system observability. |
|
24 ## |
5016
|
25 ## Default: tol = @code{tol = 10*norm(a,'fro')*eps} |
3441
|
26 ## |
4855
|
27 ## Returns 1 if the system @var{sys} or the pair (@var{a}, @var{c}) is |
3441
|
28 ## observable, 0 if not. |
|
29 ## |
5016
|
30 ## See @command{is_controllable} for detailed description of arguments |
3441
|
31 ## and default values. |
5642
|
32 ## @seealso{size, rows, columns, length, ismatrix, isscalar, isvector} |
3441
|
33 ## @end deftypefn |
|
34 |
|
35 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
36 ## Created: August 1993 |
|
37 ## Updated by John Ingram (ingraje@eng.auburn.edu) July 1996. |
|
38 |
|
39 function [retval, U] = is_observable (a, c, tol) |
|
40 |
|
41 if( nargin < 1) |
6046
|
42 print_usage (); |
4030
|
43 elseif(isstruct(a)) |
3441
|
44 ## system form |
|
45 if(nargin == 2) |
|
46 tol = c; |
|
47 elseif(nargin > 2) |
6046
|
48 print_usage (); |
3441
|
49 endif |
|
50 [a,b,c] = sys2ss(a); |
|
51 elseif(nargin > 3) |
6046
|
52 print_usage (); |
3441
|
53 endif |
|
54 if(exist("tol")) |
|
55 [retval,U] = is_controllable (a', c', tol); |
|
56 else |
|
57 [retval,U] = is_controllable (a', c'); |
|
58 endif |
|
59 |
|
60 endfunction |
|
61 |