root/applications/dual/SIDP/jednoduchy system/generate_trajectories.m @ 944

Revision 862, 507 bytes (checked in by zimamiro, 15 years ago)
Line 
1function H=generate_trajectories(H,u,sigma)
2sigma_na_druhou=sigma^2;
3
4for i=1:size(H,1)-1
5    for j=1:size(H,2)
6        %aplication of best_control
7        %H(i+1,j,1)=H(i,j,1)+(H(i,j,2)+H(i,j,3)*randn)*u(i,j)+sigma*randn;
8        H(i+1,j,1)=H(i,j,1)+H(i,j,2)*u(i,j)+sigma*randn;
9
10        %kalman
11        K=u(i,j)*H(i,j,3)/(H(i,j,3)*u(i,j)^2+sigma_na_druhou);
12        H(i+1,j,2)=H(i,j,2)+K*( H(i+1,j,1)-H(i,j,1)-H(i,j,2)*u(i,j));
13        H(i+1,j,3)=(1-K*u(i,j))*H(i,j,3);
14    end
15   
16end
17end
Note: See TracBrowser for help on using the browser.