changeset 6697:0d98076554fc octave-forge

control-oo: add another test
author paramaniac
date Sat, 13 Feb 2010 18:31:57 +0000
parents 01a0097c7815
children af8f5fc5111a
files extra/control-oo/inst/estim.m extra/control-oo/inst/kalman.m
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extra/control-oo/inst/estim.m	Sat Feb 13 16:44:37 2010 +0000
+++ b/extra/control-oo/inst/estim.m	Sat Feb 13 18:31:57 2010 +0000
@@ -67,4 +67,12 @@
 %! [a, b, c, d] = ssdata (est);
 %! m = [a, b; c, d];
 %! m_exp = [-7, 5; 1, 0; 1, 0];
+%!assert (m, m_exp, 1e-4);
+
+%!shared m, m_exp
+%! sys = ss (-1, 2, 3, 4);
+%! est = estim (sys, 5);
+%! [a, b, c, d] = ssdata (est);
+%! m = [a, b; c, d];
+%! m_exp = [-16, 5; 3, 0; 1, 0];
 %!assert (m, m_exp, 1e-4);
\ No newline at end of file
--- a/extra/control-oo/inst/kalman.m	Sat Feb 13 16:44:37 2010 +0000
+++ b/extra/control-oo/inst/kalman.m	Sat Feb 13 18:31:57 2010 +0000
@@ -29,6 +29,8 @@
 function [est, g, x] = kalman (sys, q, r, s = [])
 
   ## TODO: complex case (sensors, known, type "current" or "delayed" for discrete systems)
+  
+  ## FIXME: return correct estimator for systems with d != 0
 
   if (nargin < 3 || nargin > 4)
     print_usage ();
@@ -38,7 +40,7 @@
     print_usage ();
   endif
 
-  [a, b, c, d] = ssdata (sys);
+  [a, b, c] = ssdata (sys);
 
   if (isempty (s))
     bs = [];