title: How to assign a specific color that doesn't change through looping, to each element of a 3D array
body: <p>First I would like to note that I'm quite a beginner in using MATLABalthough I have some idea of syntax. I am working on a project trying to map the displacement of a particle in the environment. I have already manipulated all the data so it's all down to estetics. 
  So basically I have two matrices 12 by 19 by 15, in which the coordinates (lat, long) of the particles are and the third dimension are timesteps. So the location of a particle changes through time. Now I wish to plot this in a way that at the first time step each element (so 12 by 19 although there are quite a few zeros and NaNs in the array) has it's own color that doesn't change in the next time step. This way you could track the movement of the particle. Note that I am operating with two matrices (one for latitude and the other for longitude, giving the location of the particle). So the plotting looks something like this</p>
  
  <pre><code>for it=1:nt
      plot(lat(:,:,it), long(:,:,it), 's'); hold on; 
  end
  </code></pre>
  
  <p>It would also be nice if a connector line would be drawn in each succesive time step between the previous location and the new one. </p>
  
  <p>I am having problems with this because when I assign the color in <code>plot()</code> all the elements get their own color. Also when I try to draw lines, all elements in a time step get connected to each other and it's all just a big mess. I can do for only one particle, but if I introduce many it doesn't work.</p>