Signal_processing: check number of input argmuents in kalm 09/13109/1
Paul BIGNIER [Fri, 8 Nov 2013 10:51:15 +0000 (11:51 +0100)]
kalm accepts 8 input arguments, no more, no less.

Change-Id: I783be724166fb9776315c43fa7552d1d79307b29

scilab/modules/signal_processing/macros/kalm.sci

index 8422a63..baa54ec 100644 (file)
@@ -24,6 +24,9 @@ function [x1,p1,x,p]=kalm(y,x0,p0,f,g,h,q,r)
     //        :based on data up to t=0
     //!
 
+    if argn(2) <> 8 then
+        error(sprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), "kalm", 8));
+    end
     k=p0*h'*(h*p0*h'+r)**(-1);
     p=(eye(p0)-k*h)*p0;
     p1=f*p*f'+g*q*g';