title: Two for loops in MATLAB, one not working
body: <p>I have some code which is running regressions, </p>
  
  <p>I got some great code on stack overflow, yesterday, which helps to insert the x variables.  </p>
  
  <pre><code>  %My attempt a Minimal, Complete, and Verifiable example
  clear; 
  % K: horizon
  Myarbitrarycombinations= [7 8; 7 4;];
  
  for ii=size(Myarbitrarycombinations,1)
   for j = [1, 2, 3];
       K=j;
  
  Myarbitrarycombinations(ii,1)
  Myarbitrarycombinations(ii,2)
  
  
  
  end 
  end
  </code></pre>
  
  <p>The problem I am having is with the "K" for loop, in the above code. </p>
  
  <p>The code is returning </p>
  
  <pre><code>K=1, 7 4
  K=2, 7 4
  K=3, 7 4
  </code></pre>
  
  <p>However, I would like it to return, </p>
  
  <pre><code>K=1, 7 4
  K=2, 7 4
  K=3, 7 4
  </code></pre>
  
  <p>and</p>
  
  <pre><code>K=1, 7 8
  K=2, 7 8
  K=3, 7 8
  </code></pre>