Vladislav Basimov edited text_MATLAB_begin_verbatim_clear__.tex  almost 8 years ago

Commit id: b385fb1ead24c7c01cf9251c9c74d59df4c1cf05

deletions | additions      

       

for t=1:(N-1)  x(t+1)=(a*x(t)+sin(t)*t)+normrnd(0,sigmaPsi)  y(t+1)=b*x(t+1)+normrnd(0,sigmaEta) %add error on current measurement  %chop  if y(t+1) >= Value  y(t+1) = Value;  elseif y(t+1) <= -Value  y(t+1) = -Value;  end    eOpt(t+1)=sqrt((sigmaEta^2)*(eOpt(t)^2+sigmaPsi^2)/(sigmaEta^2+eOpt(t)^2+sigmaPsi^2));  K(t+1)=(eOpt(t+1))^2/sigmaEta^2;  xOpt(t+1)=(a*xOpt(t)+sin(t)*t)*(1-K(t+1))+K(t+1)*y(t+1)    %chop  if xOpt(t+1) >= Value  xShow(t+1) = Value  elseif xOpt(t+1) <= -Value  xShow(t+1) = -Value  else  xShow(t+1)= xOpt(t+1);  end  end;  plot(k,x,k,y,k,xShow) plot(k,x,k,y,k,xOpt)  \end{verbatim}