As a short term solution, I used the handles object via handles.xdata and handles.ydata to pass my data to another callback and run the analysis again when adding the charts to a report.
%%Assay Plot
f = figure;
%%Fit: 'Parallel Line Plot'.
[xData, yData] = prepareCurveData( handles.logdataUnitsmL, handles.Standard );
% Set up fittype and options.
ft = fittype( 'poly1' );
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft )
stdcoeff = coeffvalues(fitresult)
stdRsquare = gof.rsquare
% Plot fit with data.
plot( fitresult,'-r', xData, yData , '.r');
a = get(gca,'Children')
hold on
%Second Plot
[xData, yData] = prepareCurveData( handles.logdataUnitsmL, handles.Test );
% Set up fittype and options.
ft = fittype( 'poly1' );
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft )
testcoeff = coeffvalues(fitresult)
testRsquare = gof.rsquare
% Plot fit with data.
plot(fitresult, '-b',xData, yData,'.b');
b = get(gca,'Children')
hold on
h = [a;b]
title('Heparin Sodium Parallel Line Assay')
legend(h, 'Standard Regression','Standard Assays', 'Test Regression', 'Test Assays', 'Location', 'NorthEast' );
% Label axes
xlabel('ln Units/mL')
ylabel('Absorbance')
grid on
fig = Figure(f)
add(sec1,fig)
%other chapters and sections here...
add(rpt,ch1)
close(f)
I prefer not doing this; however, I haven't found a way of passing the handles.axes object from the GUIDE. If someone has a solution I would like to know and accept a better answer!
Also, I found that setting the figure to and object "f" allows the figure to added to the report, and closed after the chapter is added to the report. Closing the figure after adding the section will result in error.