view m-toolbox/html_help/help/ug/sigproc_polyfit_content.html @ 42:f90d4f666cc7 database-connection-manager

Cleanup
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 18:04:34 +0100
parents f0afece42f48
children
line wrap: on
line source

<p>
  <a href="matlab:doc('ao/polyfit')">polyfit.m</a> overloads the polyfit() function of MATLAB for Analysis Objects.<br/>
  The script calls the following MATLAB functions:
  <ul>
    <li> polyfit.m </li>
    <li> polyval.m </li>
  </ul>
  <h2><a name="usage">Usage</a></h2>
  <div class="fragment"><pre>
      <span class="comment">% CALL:        b = polyfit(a, pl)</span>
      <span class="comment">%</span>
      <span class="comment">% Parameters:  'N'      - degree of polynomial to fit</span>
      <span class="comment">%              'coeffs' - (optional) coefficients</span>
      <span class="comment">%                         formed e.g. by [p,s] = polyfit(x,y,N);</span>
  </pre></div>
  The MATLAB function polyfit.m finds the coefficients of the polynomial p(x) of degree N that fits the vector 'x' to the vector 'y', in a least squares sense.<br/> After this in the script <a href="matlab:doc('ao/polyfit')">polyfit.m</a> the function polyval.m is called, which  evaluates the polynomial of order 'N' according to these coefficients. <br/>
  Using the output of polyval.m the fitted data series is created and outputted as analysis object.
</p>