This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% x : state vector [pos;speed] | |
% X : estimate vector | |
% n : noise vector - Q : cov.matrix | |
% z : measurement vector | |
% v : measurement noise - R : cov.matrix | |
% | |
% F_x : transition matrix | |
% F_n: noise matrix | |
% H : measurement matrix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w1=(rand(3,2)-0.5).*2+0.1; | |
w2=(rand(3,1)-0.5).*2+0.1; | |
ita=1; | |
alpha=1; | |
%x=[1 1;1 3;1 2;1 4]; | |
%x=[ones(4,1).*(-1) x]; | |
x=[0 0;1 1; 1 0; 0 1]; | |
h=[0 0 0 0]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [w,flag] = learning(flag,w,omega,target ) | |
%UNTITLED3 Summary of this function goes here | |
% Detailed explanation goes here | |
ita=1; | |
result=(omega*w)>0; | |
result=target-result; | |
for i = 1 : 3 | |
if result(i) == 0 | |
continue |