title: Matlab return vector
body: <p>Sorry for the beginners matlab question...</p>
  
  <pre><code>function [ A B C ] = crunch(i)
    A = i^2;
    B = 2*A;
    C = A+B;
  end;
  
  vals = zeros(5,3);
    for i=1:5
      vals(i,:) = crunch(i);
    endfor;
  disp(vals);
  </code></pre>
  
  <p>This is not the result I expected.</p>
  
  <pre><code>vals =
   1 1 1
   4 4 4
   9 9 9
   ..... etc
  </code></pre>
  
  <p>if I instead explicitiy place A, B &amp; C in a row vector and return that, then everything is fine.</p>
  
  <pre><code>function retval = crunch(i)
    A = i^2;
    B = 2*A;
    C = A+B;
    retval = [ A B C ];
  end;
  
  ans = 
    1    2    3
    4    8   12
    9   18   27
   16   32   48
   25   50   75
  </code></pre>
  
  <p>What's going wrong here?</p>