Graphics Programs Reference
In-Depth Information
% enter the measurement noise variance
R = .035;
% this is the state noise variance
nvar = .5;
[residual, estimate] = kalman_filter(npts, T, X0, inp, R, nvar);
figure(1)
plot(residual)
xlabel ('Sample number')
ylabel ('Residual')
figure(2)
subplot(2,1,1)
plot(inp)
axis tight
ylabel ('position - truth')
subplot(2,1,2)
plot(estimate)
axis tight
xlabel ('Sample number')
ylabel ('Predicted position')
Listing 9.6. MATLAB Function Ðmaketraj.mÑ
function [times , trajectory] = maketraj(start_loc, xvelocity, yamp, yperiod,
zamp, zperiod, samplingtime, deltat)
% maketraj.m
% by David J. Hall
% for Bassem Mahafza
% 17 June 2003
% 17:01
% USAGE: [times , trajectory] = maketraj(start_loc, xvelocity, yamp, yperiod,
zamp, zperiod, samplingtime, deltat)
% NOTE: all coordinates are in radar reference coordinates.
% INPUTS
% name dimension explanation units
%------ ------ --------------- -------
% start_loc 3 X 1 starting location of target m
% xvelocity 1 velocity of target m/s
% yamp 1 amplitude of oscillation y direction m
% yperiod 1 period of oscillation y direction m
% zamp 1 amplitude of oscillation z direction m
% zperiod 1 period of oscillation z direction m
% samplingtime 1 length of interval of trajectory sec
% deltat 1 time between samples sec
%
Search WWH ::




Custom Search