Trivial Kalman Filter
Unidimensional trivial Kalman filter (header only, Arduino compatible) library
covariance.m
1 #!/usr/bin/octave-cli -qf
2 #
3 # Covariance calculator.
4 #
5 # Copyright (c) 2018 Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
6 #
7 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
9 #
10 # Permission is hereby granted to use or copy this program
11 # for any purpose, provided the above notices are retained on all copies.
12 # Permission to modify the code and to distribute modified code is granted,
13 # provided the above notices are retained, and a notice that the code was
14 # modified is included with the above copyright notice.
15 #
16 #
17 # Usage: ./covariance.m <input-file> <0-indexed-column-number>
18 #
19 # Example:
20 # $ ./covariance.m DS18B20Test.csv 0
21 # 0.00468921411002
22 #
23 
24 infile = argv(){1};
25 column = str2num(argv(){2});
26 
27 printf("%.12g\n", cov(dlmread(infile, " ", [0, column, inf, column])));