3441
|
1 ## Copyright (C) 1993, 1994, 1995 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 |
|
6 ## under the terms of the GNU General Public License as published by the |
|
7 ## Free Software Foundation; either version 2, or (at your option) any |
|
8 ## later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ## for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
|
18 |
|
19 ## -*- texinfo -*- |
3502
|
20 ## @deftypefn {Function File} {[@var{retval}, @var{u}] =} is_observable (@var{a}, @var{c}, @var{tol}) |
|
21 ## @deftypefnx {Function File} {[@var{retval}, @var{u}] =} is_observable (@var{sys}, @var{tol}) |
3441
|
22 ## Logical check for system observability. |
|
23 ## |
|
24 ## Default: tol = 10*norm(a,'fro')*eps |
|
25 ## |
|
26 ## Returns 1 if the system @var{sys} or the pair (@var{a},@var{c}) is |
|
27 ## observable, 0 if not. |
|
28 ## |
|
29 ## @strong{See} @code{is_controllable} for detailed description of arguments |
|
30 ## and default values. |
|
31 ## @end deftypefn |
4030
|
32 ## @seealso{size, rows, columns, length, ismatrix, isscalar, and isvector} |
3441
|
33 |
|
34 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
35 ## Created: August 1993 |
|
36 ## Updated by John Ingram (ingraje@eng.auburn.edu) July 1996. |
|
37 |
|
38 function [retval, U] = is_observable (a, c, tol) |
|
39 |
|
40 if( nargin < 1) |
|
41 usage("[retval,U] = is_observable(a , c {, tol})"); |
4030
|
42 elseif(isstruct(a)) |
3441
|
43 ## system form |
|
44 if(nargin == 2) |
|
45 tol = c; |
|
46 elseif(nargin > 2) |
|
47 usage("[retval,U] = is_observable(sys {, tol})"); |
|
48 endif |
|
49 [a,b,c] = sys2ss(a); |
|
50 elseif(nargin > 3) |
|
51 usage("[retval,U] = is_observable(a , c {, tol})"); |
|
52 endif |
|
53 if(exist("tol")) |
|
54 [retval,U] = is_controllable (a', c', tol); |
|
55 else |
|
56 [retval,U] = is_controllable (a', c'); |
|
57 endif |
|
58 |
|
59 endfunction |
|
60 |