title: Plot curve fit with errorbars
body: <p>When curve-fitting using the Matlab package cftool, there is an option to generate code corresponding to a fit.  Here is a sample result:</p>
  
  <pre><code>%% Fit: 'myfit'.
  [xData, yData, weights] = prepareCurveData( x, y, weights);
  
  % Set up fittype and options.
  ft = fittype( 'a^x+b', 'independent', 'x', 'dependent', 'y' );
  opts = fitoptions( ft );
  opts.Display = 'Off';
  opts.Lower = [-Inf -Inf];
  opts.StartPoint = [0 0];
  opts.Upper = [Inf Inf];
  opts.Weights = weights;
  
  % Fit model to data.
  [fitresult, gof] = fit( xData, yData, ft, opts );
  
  % Plot fit with data.
  figure( 'Name', 'myfit' );
  h = plot( fitresult, xData, yData );
  % Label axes
  xlabel( 'x' );
  ylabel( 'y' );
  grid on
  </code></pre>
  
  <p>I would like to plot the same fit with custom error bars, using a separate vector of errors.  Ordinarily, I would use the function <code>errorbar()</code> in place of <code>plot()</code>, but it does not accept <code>fitobject</code> objects like the <code>fitresult</code> in this code.  In fact, the only reason this code works with <code>plot()</code> is that there's <a href="http://www.mathworks.com/help/curvefit/plot.html" rel="nofollow">an overloaded version of <code>plot()</code></a> in the curve-fitting toolbox, totally separate from the normal <code>plot()</code>, that does accept these objects.</p>
  
  <p><strong>How can I plot cftool fits with errorbars?</strong></p>