title: Potential Bug in MATLAB regress R2014a
body: <p>MATLAB R2014a used to work fine w regress but now I get an error when the variables are fine and rank is satisfactory.</p>
  
  <pre><code>X = rand([10 3])
  
  X =
  
      0.8407    0.3517    0.0759
      0.2543    0.8308    0.0540
      0.8143    0.5853    0.5308
      0.2435    0.5497    0.7792
      0.9293    0.9172    0.9340
      0.3500    0.2858    0.1299
      0.1966    0.7572    0.5688
      0.2511    0.7537    0.4694
      0.6160    0.3804    0.0119
      0.4733    0.5678    0.3371
  
  K&gt;&gt; Y = rand([10 1])
  
  Y =
  
      0.1622
      0.7943
      0.3112
      0.5285
      0.1656
      0.6020
      0.2630
      0.6541
      0.6892
      0.7482
  
  
  [B,BINT] = regress(Y,X)
  
  Subscript indices must either be real positive integers or logicals.
  
  Error in regress (line 93)
  b(perm) = R \ (Q'*y);
  </code></pre>
  
  <p>Obviously, X and Y are fine. There's something wrong w/ the matrix math in regress and it's that perm is, for some reason, being output as a vector (giving an ind error).  A few lines above, qr is called like this with no further modification to perm:</p>
  
  <pre><code>[Q,R,perm] = qr(X,0);
  </code></pre>
  
  <p>Help file says qr is supposed to output a third argument that's a matrix - but how can that be if the math always expects a vector? </p>
  
  <pre><code>%   [Q,R,E] = QR(A) produces unitary Q, upper triangular R and a
  %   permutation matrix E so that A*E = Q*R. The column permutation E is
  %   chosen so that ABS(DIAG(R)) is decreasing.
  </code></pre>
  
  <p>Very confusing considering both of these are built-in functions. I literally re-installed MATLAB R2014a and a few toolboxes and STILL get this error. It feels like qr got updated to output a different argument, but I don't understand why a fresh reinstall wouldn't take care of this, or why qr would have updated at all anyways. Everything else in my MATLAB is great.</p>
  
  <p>Any ideas???</p>