title: matlab fill array with vectors
body: <p>I wish to populate an nxn matrix with vectors. I have the following:</p>
  
  <pre><code>[x y] = meshgrid(a);
  for i:size(a,1)
      for j:size(a,2)
          b = [x(i,j),y(i,j) 0];
      end
  end
  </code></pre>
  
  <p>I think may be being a bit naive here as I am expecting a range of different numbers within the vector elements of b. Instead I am getting the elements of b are all equal. also</p>
  
  <pre><code>size(b) = 1 3
  size(b(1,1)) = 1 1
  </code></pre>
  
  <p>I am expecting size(b(1,1)) = 1 3 as each element in b should be a vector of length 3. can someone tell me where I have gone wrong? Thanks very much.</p>