% 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);

nk = ones(tr_period,1)*estMar;

plot( 1:N, nk(:));
axis([0 N 0 4]);
xlabel 'Time';
ylabel 'Number of Tracks'
title '(b) Estimated  Number of Tracks';

hold off
