title: How can I change the color of the plot in each iteration in MATLAB?
body: <p>The following is a part of my matlab code. As it's shown, I would like to plot 8 curves in one plot. But I want to make each curve with one unique color. I also want to change the legend so that it changes for each <code>i</code>. </p>
  
  <p>For instance, for i=1 the legend will be gho-1, for i=2 gho-2 and so on. I want it to be automatic because I will change the <code>i</code> sometimes from ex:(i=1:20).</p>
  
  <pre><code>for i=1:8
  .
  .
  .
  plot(b,r,'b');
  legend(['qho-',num2str(i)]);    
  hold on
  end
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>Hi again,</p>
  
  <p>I have other question:
  if I have the following</p>
  
  <pre><code>for i=1:8
  .
  b1=(1:3,:)
  b2=(3:6,:)
  figure(1);plot(b1,r,'*');
  figure(2);plot(b2,r,'*');
  
  Leg{i} = ['qho-',num2str(i)];    
  
  end
  legend(Leg)
  </code></pre>
  
  <p>I got only color legend for the last figure only. not for both..
  how can I solve that ?!</p>
  
  <p>Thanks again</p>