📄 kalmants.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -