function [x_str,y_str] = bfitevalfitbutton(datahandle,fit, expression, plotresultson, clearresults)
% BFITEVALFITBUTTON Interpolate/exrapolate using expression for fit.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.13 $  $Date: 2000/09/20 00:15:36 $

if nargin < 5
    clearresults = 0;
end
if clearresults
    x = []; y = []; errmsg = []; 
else
    [x,y,errmsg] = bfitevalfit(expression,datahandle,fit);
end
evalresults = getappdata(datahandle,'_Basic_Fit_EvalResults');
evalresults.x = x; % x that we eval over (x = expression)
evalresults.y = y; % y = f(x) that we eval over (x = expression)
evalresults.string = expression;
% evalresults.handle will get set in bfitcheckplotresults below
% so we don't want to overwrite that handle since we'll need to delete
% the old one.
if ~isfield(evalresults,'handle')
	evalresults.handle = [];
end
setappdata(datahandle,'_Basic_Fit_EvalResults',evalresults);
format = '%10.3g';
x_str = cellstr(num2str(x,format));
y_str = cellstr(num2str(y,format));

plotresults = bfitcheckplotresults(plotresultson,datahandle,fit);
 
