📄 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 %均方根测量误差
sigmaX=[1;2;3];sigmaY=[1;2;3];fOptimal=0; %05-09-27乐加
EstAve = [0 0 0];
MeasAve = [0 0 0];
for i = 1 : 5
[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 + -