Fw: [求救 1000P] 有一行程式的意思看不懂=.=...

作者: Ecampus (7.7)   2018-05-03 18:32:53
下面是一個自由落體的模型,結合卡爾曼濾波器。
我先講解一下,以下是kalman-filter五條公式
https://imgur.com/a/85OkG
https://imgur.com/a/kCCjz
然後,在下面這2張圖,是把參數代入之後的情況(或許可以作為參考)
https://imgur.com/a/kTSfpfS (迭代 第一次)
https://imgur.com/a/3aGo1km (迭代 第二次)
然後各參數我都有,就只是代入就好....只是我最後面有一行程式碼看不懂=.=
以下是code碼:
% Kalman filter for the example of free body falling
% Using previous data to modified
clear all
clc
II=eye(2,2);
N=15;
%y0=[100 99.5 98.0 95.5 92.0 87.5 82.0]
%y =[0 100 97.9 94.4 92.7 87.3 82.1]
y0=[100 99.5 98.0 95.5 92.0 87.5 82.0 75.5 68.0
59.5 50.5 39.5 28.0 15.5 2.0]
y= [100 100.0 97.9 94.4 92.7 87.3 82.1 75.4 68.8
59.0 50.6 39.4 28.3 14.5 2.1]
A=[1 1
0 1]
U=[-0.5
-1.0]
H=[1 0]
R=1
x=zeros(2,1,N); % N代表"次數",此程式N為15。表示迭代了15次。
x(:,1,1)=[95
1];
x0=zeros(1,N)
p=zeros(2,2,N);
p(:,:,1)=[10 0
0 1];
kg=zeros(2,1);
for k=2:N
x(:,1,k) = A*x(:,1,k-1)+U;
p(:,:,k) = A*p(:,:,k-1)*A';
kg(:,1,k) = p(:,:,k)*H' / (H*p(:,:,k)*H'+R);
x(:,1,k)=x(:,1,k)+kg(:,1,k)*(y(k-1)-H*x(:,1,k-1));
x0(1,k)=x(1,1,k);
p(:,:,k)=(II-kg(:,1,k)*H)*p(:,:,k);;
end
y0
y
x0
t=1:N;
plot(t,y0,'r',t,y,'g',t,x0,'b');
=================================================
我想問的是,這一行程式碼 x0(1,k)=x(1,1,k); 的涵義是??
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: Ecampus (125.230.88.172), 05/03/2018 18:32:53
※ 編輯: Ecampus (125.230.88.172), 05/03/2018 18:33:19
※ 編輯: Ecampus (125.230.88.172), 05/03/2018 19:06:08
※ 編輯: Ecampus (125.230.88.172), 05/03/2018 19:08:01

Links booklink

Contact Us: admin [ a t ] ucptt.com