File: srkf.dia.ref

package info (click to toggle)
scilab 6.0.1-10%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 365,292 kB
  • sloc: xml: 827,376; cpp: 273,125; ansic: 216,672; java: 190,706; fortran: 90,783; ml: 24,107; tcl: 16,853; sh: 13,608; makefile: 9,556; lex: 1,615; perl: 1,566; yacc: 1,263; php: 690; cs: 614
file content (20 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//<-- CLI SHELL MODE -->
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2013 - Scilab Enterprises - Charlotte Hecquet
// Copyright (C) 2013 - Scilab Enterprises - Sylvestre Ledru
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
f=[0 0 1; 0 1 0; 2 3 4]; //State matrix
g=[1;-1;1]; //Input matrix
h=[1 1 0; 0 1 0; 0 0 0]; //Output matrix
Q=[3 2 1; 2 2 1; 1 1 1]; //Covariance matrix of dynamic noise
R=[2 1 1; 1 1 1; 1 1 2]; //Covariance matrix of observation noise
// Initialisation
p0=[6 3 2; 3 5 2; 2 2 4];
x0=[1;1;1];
y=[2 8 7]'; // Current observation output matrix
[x1,p1]=srkf(y,x0,p0,f,h,Q,R);
assert_checkalmostequal(p1, [-3.3826684796422888,0,0;-0.65452136096190749,1.43147468495118102,0;-10.588783837170105,-2.49768257747417177,-5.87595341369592727]);
assert_checkalmostequal(x1, [1.07553956834532438;4.10971223021582333;6.06654676258992787]);