function film( x, P, NFig, q, r )

N = length(x);
v=get(0,'ScreenSize');
Str=strcat(strcat(strcat(strcat(' ( q=',num2str(q)),', r='),num2str(r)),' )');

h=figure(NFig); hold on;
title(strcat('Andamendo della posizione stimata e dell''incertezza',Str))
set(h,'Position',[round(v(3)/2)-300 round(v(4)/2)-250 600 500]);
xlabel('ascissa (m)');
ylabel('ordinata (m)');
mx = min(x(1,:));
Mx = max(x(1,:));
my = min(x(3,:));
My = max(x(3,:));
axis([mx-(Mx-mx)/3 Mx+(Mx-mx)/3 my-(My-my)/3 My+(My-my)/3]);

for j = 1:N
    h1 = plot_car(x(1,j),x(3,j),atan2(x(4,j),x(2,j)),0.1,'b');
    h2 = plot_ellipse(x(1,j),x(3,j),9*P([1 3],[1 3],j),'r');
    M(j) = getframe;
    pause(exp(-0.1*j*j));
    delete(h1);
    delete(h2);
end
