title: Colored MATLAB Compass Graph
body: <p>I'm quite new to MATLAB and therefore any help is very appreciated. </p>
  
  <p>I want to visualize multiple vectors using MATLAB's <a href="http://www.mathworks.com/help/techdoc/ref/compass.html" rel="nofollow">compass</a> graph. Is it possible to colorize the different vectors? Those vectors change over time and the order in which they're handed to the compass graph never changes. Is there another way to distinguish the vectors?</p>
  
  <p>Thank you in advance! 
  M.</p>
  
  <p>EDIT: The solution works (i.e. arrows are colored) until the very last vector element of the compass is reached. If I do not stop the loop before, the method exits with the error ??? <code>Subscript indices must either be real positive integers or logicals..</code> Every object (i.e. arrows) of the compass is correctly adressed except the last; checked the indexes, everything seems to be ok.What can I do?</p>
  
  <p>Here's the code I currently use:</p>
  
  <pre class="lang-ml prettyprint-override"><code>handle = compass(viewframe(1,:),viewframe(2,:));
  colors = get(0,'DefaultAxesColorOrder');
  for i=1:length(handle)
     set(handle(i),'color', colors(mod(i,length(colors)),:))
  end
  </code></pre>