home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fb.zip / octave / SCRIPTS.ZIP / scripts / control / is_observable.m < prev    next >
Encoding:
Text File  |  1999-12-15  |  2.0 KB  |  61 lines

  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 -*-
  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}@})
  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
  32.  
  33. ## See also: size, rows, columns, length, is_matrix, is_scalar, is_vector.
  34.  
  35. function [retval, U] = is_observable (a, c, tol)
  36.  
  37.   ## Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993.
  38.   ## Updated by John Ingram (ingraje@eng.auburn.edu) July 1996.
  39.  
  40.   if( nargin < 1) 
  41.     usage("[retval,U] = is_observable(a , c {, tol})");
  42.   elseif(is_struct(a))
  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.  
  61.