title: For loop running over different variables
body: <p>Good day,</p>
  
  <p>I would like to do the following in Matlab:</p>
  
  <pre><code>var1 = 10;
  var2 = 15;
  var3 = 20;
  
  j = 1;
  
  for i = [var1,var2,var3]
      a(j) = i + 10;
      j = j + 1;
  end
  clear j;
  </code></pre>
  
  <p>With result:</p>
  
  <pre><code>a(1) = var1 + 10 = 20
  a(2) = var1 + 10 = 25 
  a(3) = var1 + 10 = 30
  </code></pre>
  
  <p>Any ideas?</p>