% for SPIE, K estimation

clf

subplot(2,2,1);

plot( xy1_orig(1,:), xy1_orig(2,:), 'k-');
hold on;
plot( xy2_orig(1,:), xy2_orig(2,:), 'k-');
plot( XY(1,:), XY(2,:), 'kx');
for i=1:N
  if( n1(i) )
    k = 1 + XY_offset(i);
    plot( XY(1,k), XY(2,k), 'ko');
  end
  if( n2(i))
    k = n1(i) + 1 + XY_offset(i);
    plot( XY(1,k), XY(2,k), 'ks');
  end
end
axis([0 4 0 4]);
xlabel 'X';
ylabel 'Y'
title '(a) True Tracks and Measurements';

subplot(2,2,2);

ans1 = get_kxv(1,1);
ans2 = get_kxv(1,2);
% ans3 = get_kxv(1,3);

plot( ans1(:,1), ans1(:,3), 'k-');
hold on;
plot( ans2(:,1), ans2(:,3), 'k-.');
% plot( ans3(:,1), ans3(:,3), 'b:');
axis([0 4 0 4]);
xlabel 'X';
ylabel 'Y'
title '(b) Estimated  Tracks';

hold off
