This answer will help you with the visualisation of your points and their movement history, but it does not handle the tracking of your non-zeros elements.
Let's start with sample data:
%% // sample data
nMax = 10 ; %// Max size of matrice
M0 = randi([0 1],nMax) ; %// populate with random "0" and "1"
[x,y] = find(M0==1) ; %// find coordinates of "1"s
npt = numel(x) ; %// how many have we got
Then we draw the initial state. I used 2 graphic objects per 1
: One single point display with a specific marker to show the "head" of the trace (the last position of the point), and one dotted fine line (with no markers) to show the history trace.
%% // Display initial state
hf = figure ; hax = axes('Nextplot','Add') ;
for ip = 1:npt
%// draw the lasp point (the "head")
hp(ip) = plot( x(ip) , y(ip) , 'Marker','o' , 'LineStyle','none' ) ;
%// draw the history line (empty at the moment, will populate later)
hl(ip) = plot( x(ip) , y(ip) , 'Marker','none' , 'LineStyle',':' ) ;
end
set( hax , 'XLim',[0 nMax],'YLim',[0 nMax]) %// to fix axis limits
Then the animation itself. To move the points, at each animation iteration I add a small quantity to the last coordinates. You'll have to replace that part with your own coordinate update.
Then I concatenate the new coordinate with the old ones, and update each graphic object:
%% // now do the animation
nHist = 30 ; %// number of history point to display on the trace
for animStep = 1:100
%// Movement engine
%// ---------------------------------------------------------
%// Replace this block with your own point coordinate update
x = [ x , x(:,end) + randi([-1 1],npt,1)/10 ] ;
y = [ y , y(:,end) + randi([-1 1],npt,1)/10 ] ;
x(x<0) = 0 ; x(x>nMax) = nMax ; %// keep data within boundaries
y(x<0) = 0 ; y(y>nMax) = nMax ;
%// ---------------------------------------------------------
%% // update display
for ip = 1:npt
%// update "Head" point
set( hp(ip) , 'XData',x(ip,end) ,'YData',y(ip,end) )
%// update history trace
idxTrace = max(1,size(x,2)-nHist):size(x,2) ;
set( hl(ip) , 'XData',x(ip,idxTrace) ,'YData',y(ip,idxTrace) )
end
drawnow
pause(0.1)
end
Which produces the following:

You can adjust the variable nHist
to change the number of history points you will display.
You can also change the "head" marker to something smaller if you have too many of them in your matrix.