kalmants.m

来自「基于T-s模糊模型用于估计非线性系统的状态的kalman滤波器。」· M 代码 · 共 28 行

M
28
字号
function [EstAve, MeasAve] = KalmanTS(sigmaX, sigmaY, fOptimal)

% function [EstAve, MeasAve] = KalmanTS(sigmaX, sigmaY, fOptimal)
%
% Monte-Carlo simulation of the truck-trailer system.
% INPUTS
%   sigmaX = 3-element vector containing the standard deviation of 
%            the state process noise (rad, rad, velocity)
%   sigmaY = 3-element vector containing the standard deviation of
%            the measurement noise (rad, rad, velocity)
%   fOptimal = flag indicating if we should use the optimal uncoupled
%              Kalman filter.  If 1, then we use the optimal 
%              Kalman filter.  If 0, then we use the suboptimal decoupled
%              Kalman filter.
% OUTPUTS
%   EstAve = average RMS state estimation error
%   MeasAve = average RMS measurement error

EstAve = [0 0 0];
MeasAve = [0 0 0];
for i = 1 : 20
   [EstRMS, MeasRMS] = TruckTrailer(sigmaX, sigmaY, fOptimal, 0);
   EstAve = ((i - 1) * EstAve + EstRMS) / i;
   MeasAve = ((i - 1) * MeasAve + MeasRMS) / i;
end
disp(['Average Estimation Error = ', num2str(EstAve)]);
disp(['Average Measurement Error = ', num2str(MeasAve)]);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?