I'm slightly flustered: I just fitted a graph and typed plot() beneath to plot another graph, but Matlab gives error:
%% Fit: 'untitled fit 1'.
[xData, yData] = prepareCurveData( N, A );% Set up fittype and options.
ft = fittype( 'poly6' );% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft );% Plot fit with data.
figure( 'Name', 'untitled fit 1' );h = plot( fitresult, xData, yData );legend( h, 'A vs. N', 'untitled fit 1', 'Location', 'NorthEast', 'Interpreter', 'none' );% Label axes
xlabel( 'N', 'Interpreter', 'none' );ylabel( 'A', 'Interpreter', 'none' );grid onhold onplot(x,y);axis([-15 15 200 800])
Error in AmplitudeFit (line 36)plot(x,y);
in command-window I can plot(x,y) without any issues.
Best Answer