title: How to convert 1D to 2D by Matlab program
body: <p>I would like to ask a question about Matlab program.</p>
  
  <p>I have vector <code>a</code></p>
  
  <pre><code>a = [1 2 3 4 5 6 7 8 9 10 11 12];
  </code></pre>
  
  <p>I would like to convert vector <code>a</code> to 2D array. Normally, I use this code to convert it.</p>
  
  <pre><code>m =1;
  for i=1:4
     for j=1:3
        b(i,j) = a(m);
        m=m+1;
     end
  end
  </code></pre>
  
  <p>Then <code>b</code> is a 2D matrix.</p>
  
  <pre><code>b =
  
       1     2     3
       4     5     6
       7     8     9
      10    11    12
  </code></pre>
  
  <p>Anybody, have an idea to convert 1D to 2D without using loop.</p>
  
  <p>Thanks,</p>