function film( x1,x2,x3, P1,P2, NFig )

N = length(x1);
v=get(0,'ScreenSize');


h=figure(NFig); hold on;
title('Andamendo della posizione vera (rossa), stimata tempo variante (blu) e con guadagno costante (verde) e dell''incertezza')
set(h,'Position',[round(v(3)/2)-600 round(v(4)/2)-200 1200 400]);
xlabel('ascissa (m)');
ylabel('ordinata (m)');
mx1 = min(x1(1,:));
Mx1 = max(x1(1,:));
my1 = min(x1(3,:));
My1 = max(x1(3,:));
axis([mx1-(Mx1-mx1)/3 Mx1+(Mx1-mx1)/3 my1-(My1-my1)/3 My1+(My1-my1)/3]);

for j = 1:N
    h11 = plot_car(x1(1,j),x1(3,j),atan2(x1(4,j),x1(2,j)),0.1,'b');
    h21 = plot_ellipse(x1(1,j),x1(3,j),9*P1([1 3],[1 3],j),'b');
    h12 = plot_car(x2(1,j),x2(3,j),atan2(x2(4,j),x2(2,j)),0.1,'g');
    h22 = plot_ellipse(x2(1,j),x2(3,j),9*P2([1 3],[1 3],j),'g');
    h13 = plot_car(x3(1,j),x3(3,j),atan2(x3(4,j),x3(2,j)),0.1,'r');
    M(j) = getframe;
     Legend('Stimata (Kalman ricorsivo)','Incertezza (Kalman ricorsivo)','Stimata (Kalman asintotico)',...
    'Incertezza (Kalman asintotico)','Vera','Location','EastOutside');
    pause(exp(-0.1*j*j));
    delete(h11);
    delete(h21);
    delete(h12);
    delete(h22);
    delete(h13);
end
