title: Fitting of a sphere using SVD/LMS
body: <p>I would like to fit a MR binary data of 281*398*104 matrix which is not a perfect sphere, and find out the center and radius of sphere and error also. I know LMS or SVD is a good choice to fit for sphere. </p>
  
  <p>I have tried sphereFit from <a href="http://www.mathworks.com/matlabcentral/fileexchange/34129-sphere-fit--least-squared-" rel="nofollow">matlab file exchange</a> but got an error, </p>
  
  <pre><code> &gt;&gt; sphereFit(data)  
      Warning: Matrix is singular to working precision. 
      &gt; In sphereFit at 33 
      ans =
           NaN   NaN   NaN  
  </code></pre>
  
  <p>Would you let me know where is the problem, or any others solution? </p>