% mfile plotsharkfish % plot old iteration and current one side by side hold off, clf % get current locations of sharks (as complex numbers), and plot them sharkpnt = find(shark(2:d+1,2:d+1)); sharkwhere = ZZ(sharkpnt); if length(sharkwhere) > 0, axis([0,d+1,0,d+1]), axis('square'), plot(sharkwhere,'+k') title(['Current time step i= ',num2str(i)]) hold on end % get current locations of fish (as complex numbers), and plot them fishpnt = find(fish(2:d+1,2:d+1)); fishwhere = ZZ(fishpnt); if length(fishwhere) > 0, plot(fishwhere,'or'), hold on axis([0,d+1,0,d+1]), axis('square'), title(['Current time step i= ',num2str(i)]) end pause(.001)