From: Charlotte HECQUET Date: Mon, 25 Mar 2013 15:39:11 +0000 (+0100) Subject: * Bug #4504 fixed - Function sskf did not work with two outputs (+ help page updated). X-Git-Tag: 5.4.1~94 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=refs%2Fchanges%2F94%2F10994%2F2 * Bug #4504 fixed - Function sskf did not work with two outputs (+ help page updated). Change-Id: I27e25fe18eb998320377ca9d2482e8bf68db579d --- diff --git a/scilab/CHANGES_5.4.X b/scilab/CHANGES_5.4.X index 343e749..ace431f 100644 --- a/scilab/CHANGES_5.4.X +++ b/scilab/CHANGES_5.4.X @@ -216,7 +216,9 @@ Bug fixes * Bug #3313 fixed - In the documentation, the title of a link used the XML id instead of the title of the page. -* Bug #4946 fixed - Rotated labels were badly rendered. +* Bug #4504 fixed - Function sskf did not work with two outputs (+ help page updated). + +* Bug #4946 fixed - Bad rendering of a big rotated label. * Bug #5291 fixed - strtod returned 0 when no real number was detected. diff --git a/scilab/modules/signal_processing/help/en_US/filters/sskf.xml b/scilab/modules/signal_processing/help/en_US/filters/sskf.xml index 4c7f74b..8927660 100644 --- a/scilab/modules/signal_processing/help/en_US/filters/sskf.xml +++ b/scilab/modules/signal_processing/help/en_US/filters/sskf.xml @@ -6,7 +6,10 @@ Calling Sequence - [xe,pe]=sskf(y,f,h,q,r,x0) + + xe = sskf(y,f,h,q,r,x0) + [xe, pe]=sskf(y,f,h,q,r,x0) + Arguments @@ -86,7 +89,7 @@ r=[2 0;0 2]; v=(chol(r))'*rand(2,11); y=x+v; h=eye(2,2); -[xe]=sskf(y,f,h,q,r,m0) +[xe pe]=sskf(y,f,h,q,r,m0) ]]> diff --git a/scilab/modules/signal_processing/macros/sskf.sci b/scilab/modules/signal_processing/macros/sskf.sci index 75a371a..134b539 100644 --- a/scilab/modules/signal_processing/macros/sskf.sci +++ b/scilab/modules/signal_processing/macros/sskf.sci @@ -7,7 +7,7 @@ // are also available at // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -function [xe]=sskf(y,f,h,q,r,x0) +function [xe, x]=sskf(y,f,h,q,r,x0) //=sskf(y,f,h,q,r,x0) //steady-state kalman filter // y :data in form [y0,y1,...,yn], yk a column vector @@ -21,7 +21,7 @@ function [xe]=sskf(y,f,h,q,r,x0) //get steady-state Kalman gain -x=ricc(f',h'/r*h,q,'disc') // steady state err cov + x=ricc(f',h'/r*h,q,'disc') // steady state err cov k=x*h'/(h*x*h'+r) // estimate state diff --git a/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.dia.ref b/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.dia.ref new file mode 100644 index 0000000..fd70aaf --- /dev/null +++ b/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.dia.ref @@ -0,0 +1,32 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 4504 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=4504 +// +// <-- Short Description --> +// Function sskf does not act as the documentation says: +// Only xe = sskf(y,f,h,q,r,x0) works (not [xe pe] = sskf(y,f,h,q,r,x0)) +rand("seed",5); +rand("normal"); +q=[.03 0.01;.01 0.03]; +u=rand(2,11); +f=[1.1 0.1;0 0.8]; +g=(chol(q))'; +m0=[10 10]'; +p0=[2 0;0 2]; +x0=m0+(chol(p0))'*rand(2,1); +x=ltitr(f,g,u,x0); +r=[2 0;0 2]; +v=(chol(r))'*rand(2,11); +y=x+v; +h=eye(2,2); +assert_checktrue(execstr("[xe pe]=sskf(y,f,h,q,r,m0)","errcatch")==0); diff --git a/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.tst b/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.tst new file mode 100644 index 0000000..da31b12 --- /dev/null +++ b/scilab/modules/signal_processing/tests/nonreg_tests/bug_4504.tst @@ -0,0 +1,33 @@ +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= +// +// <-- CLI SHELL MODE --> +// +// <-- Non-regression test for bug 4504 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=4504 +// +// <-- Short Description --> +// Function sskf does not act as the documentation says: +// Only xe = sskf(y,f,h,q,r,x0) works (not [xe pe] = sskf(y,f,h,q,r,x0)) + +rand("seed",5); +rand("normal"); +q=[.03 0.01;.01 0.03]; +u=rand(2,11); +f=[1.1 0.1;0 0.8]; +g=(chol(q))'; +m0=[10 10]'; +p0=[2 0;0 2]; +x0=m0+(chol(p0))'*rand(2,1); +x=ltitr(f,g,u,x0); +r=[2 0;0 2]; +v=(chol(r))'*rand(2,11); +y=x+v; +h=eye(2,2); +assert_checktrue(execstr("[xe pe]=sskf(y,f,h,q,r,m0)","errcatch")==0);