www.pudn.com > Kalman_matlab00000.rar > generatezk.m, change:2003-10-29,size:418b


function generatezk 
try  
    load inidata; 
catch 
    msgbox('The filter has not been initialized!','Warning','warn','modal'); 
    return 
end 
 
ti=get(findobj(gcf,'tag','time'),'userdata'); 
sigma0=sqrt(diag(P0)); 
sigmaw=sqrt(diag(Q)); 
sigmav=sqrt(diag(R)); 
X=normrnd(X0,sigma0); 
for k=1:ti(2)+1 
    w=normrnd(0,sigmaw); 
    v=normrnd(0,sigmav); 
    Zkk{k}=H*X+v; 
    X=A*X+B*w;     
end 
 
save fZk Zkk;