function M = AVG_show_traj(q)
%

[num_q,~] = size(q);

for e = 1:num_q
    clf
    traj = q(e).traj;
    min_x = min(traj(:,1))-0.1;
    max_x = max(traj(:,1))+0.1;
    min_y = min(traj(:,2))-0.1;
    max_y = max(traj(:,2))+0.1;
    plot(min_x,min_y,'w.');
    hold on
    plot(max_x,max_y,'w.');
    [n,~] = size(traj);
    for k = 1:n
        plot(traj(k,1),traj(k,2),'k*');
        pause(1);
        M(k) = getframe(gcf);
    end
end
