function [axesCount,fitschecked,bfinfo, ...
        evalresultsstr,evalresultsxstr,evalresultsystr,currentfit,coeffresidstrings] = ...
    bfitgetcurrentinfo(datahandle);
% BFITGETCURRENTINFO

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

fighandle = get(get(datahandle,'parent'),'parent');
axesCount = getappdata(fighandle,'_Basic_Fit_Fits_Axes_Count');
fitschecked = getappdata(datahandle,'_Basic_Fit_Showing');

evalresults = getappdata(datahandle,'_Basic_Fit_EvalResults');
format = '%10.3g';
evalresultsstr = evalresults.string;
if isempty(evalresults.x)
    evalresultsxstr = '';
else   
    evalresultsxstr = cellstr(num2str(evalresults.x,format));
end
if isempty(evalresults.y)
    evalresultsystr = '';
else
    evalresultsystr = cellstr(num2str(evalresults.y,format));
end

currentfit = getappdata(datahandle,'_Basic_Fit_NumResults_');

allcoeff = getappdata(datahandle,'_Basic_Fit_Coeff');
allresids = getappdata(datahandle,'_Basic_Fit_Resids');

if ~isempty(currentfit)
coeffresidstrings = ...
    bfitcreateeqnstrings(currentfit,allcoeff{currentfit+1},norm(allresids{currentfit+1}));
else
    coeffresidstrings = '';
end

guistate = getappdata(datahandle,'_Basic_Fit_Gui_State');
guistatecell = struct2cell(guistate);
bfinfo = [guistatecell{:}];