3279
|
1 # Copyright (C) 1993, 1994, 1995 Auburn University. All Rights Reserved |
3213
|
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 |
3284
|
17 # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
3213
|
18 |
|
19 function [retval,U] = is_detectable (a,c,tol) |
|
20 |
|
21 # [retval,U] = is_detectable (a,c,tol) |
|
22 # usage: is_detectable (a , c {,tol}) |
|
23 # or is_detectable (sys {,tol}) |
|
24 # |
|
25 # Default: tol = 10*norm(a,'fro')*eps |
|
26 # |
|
27 # Returns 1 if the system, a, is detectable, 1 if the pair (a, c) is |
|
28 # detectable, or 0 if not. |
|
29 # |
|
30 # See also: size, rows, columns, length, is_matrix, is_scalar, is_vector. |
|
31 |
|
32 # Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993. |
|
33 # Updated by John Ingram (ingraje@eng.auburn.edu) July 1996. |
|
34 |
|
35 if( nargin < 1) |
|
36 usage("[retval,U] = is_detectable(a , c {, tol})"); |
|
37 elseif(is_struct(a)) |
|
38 # system form |
|
39 if(nargin == 2) |
|
40 tol = c; |
|
41 elseif(nargin > 2) |
|
42 usage("[retval,U] = is_detectable(sys {, tol})"); |
|
43 endif |
3228
|
44 [a,b,c] = sys2ss(a); |
3213
|
45 elseif(nargin > 3) |
|
46 usage("[retval,U] = is_detectable(a , c {, tol})"); |
|
47 endif |
|
48 if(exist("tol")) |
|
49 [retval,U] = is_stabilizable (a', c', tol); |
|
50 else |
|
51 [retval,U] = is_stabilizable (a', c'); |
|
52 endif |
|
53 |
|
54 |
|
55 endfunction |
|
56 |