title: Fit plane to N dimensional points in MATLAB
body: <p>I have a set of <code>N</code> points in <code>k</code> dimensions as a matrix of size <code>N X k</code>.</p>
  
  <p>How can I find the best fitting line through these points? The line will be a plane (hyerpplane) in <code>k</code> dimensions. It will have <code>k</code> coefficients and one bias term.</p>
  
  <p>Existing functions like <code>fit</code> seem to be usable only for points in 2 or 3 dimension.</p>