title: 2d polynomial fitting to table data MATLAB
body: <p>I am trying to use 2D polynomial fitting for my table data, my data format is exactly like the link below:
  <a href="http://www.mathworks.de/help/toolbox/curvefit/brx2ldg-1.html#bso46rp-1" rel="nofollow">http://www.mathworks.de/help/toolbox/curvefit/brx2ldg-1.html#bso46rp-1</a></p>
  
  <p>I mean I have vector <code>X</code> with length <code>n</code>, <code>Y</code> with length <code>m</code> and <code>m*n</code> Matrix <code>Z</code>, I would like to fit 5 degree 2d polynomial to my data,</p>
  
  <p>I am wondering that is there any syntax in MATLAB for solving this problem? like SFIT command in IDL, <a href="http://star.pst.qub.ac.uk/idl/SFIT.html" rel="nofollow">http://star.pst.qub.ac.uk/idl/SFIT.html</a></p>
  
  <p>I have <code>cftool</code> and <code>sftool</code>, but it seems that they don't work for this purpose or most probably I don't know how to employ them.</p>
  
  <p>and I know that there some m.file which people share in MATLAB Mathworks file exchange, please if you know one works properly, suggest me.</p>
  
  <p>I'd appreciate any help and comment.</p>