Animator for the local attraction model from Asynchrony induces polarization in attraction-based models of collective motion

Matlab function for animating the 2D local attraction model on a periodic LxL square with N particles, of which Na update asynchronously and N-Na update synchronously, for T time steps with relative strength of local attraction c. To run the animator download the file codeS2.m, open Matlab, set current directory to where codeS2.m is located, and then run the command codeS2(L,N,Na,T,c,K) from the command line with all parameters specified. In addition to the five parameters L,N,Na,T and c specified above the parameter K specifies how often a frame will be captured for the animation. For example, if K=1 all simulation steps will be animated, if K=100 every 100th simulation step will be animated. Examples: One Swarm: codeS2(10,50,50,100,2,1) (Potentially) several swarms: codeS2(50,100,100,600,2,1) One Mill: codeS2(10,50,50,100,1,1) (Potentially) several Mills: codeS2(50,100,100,600,0.5,1) One Polarised group: codeS2(10,50,50,2000,0.15,10) (Potentially) several Polarised Groups: codeS2(50,100,100,4000,0.15,10) ! Note that K=10 here, so only every 10th frame is included in the animation, set K=1 to include every time step.