The curve fitting tool won't open when using the cftool command or when clicking on Curve Fitting in Apps. There is also an error message.

18 次查看(过去 30 天)
That's my code:
xvals = (-20:1:20)';
yvals = xvals.^2;
plot(xvals,yvals,'.','MarkerSize',20)
cftool(xvals,yvals)
Which gives me an error message:
Warning: Error occurred while executing the listener callback for event FitAdded defined for class sftoolgui.FitsManager:
Dot indexing is not supported for variables of this type.
Error in sftoolgui.Figure/addToDesktopGroup
Error in sftoolgui.Figure
Error in sftoolgui.FitFigure (line 59)
this = this@sftoolgui.Figure(sftool);
Error in sftoolgui.sftool/fitAdded (line 146)
fitFigure = sftoolgui.FitFigure(h, evt.HFitdev, []);
Error in sftoolgui.sftool>@(s,e)h.fitAdded(e) (line 83)
h.createListener(fm, 'FitAdded', @(s, e) h.fitAdded( e ) );
Error in sftoolgui.FitsManager/newFit (line 35)
notify (this, 'FitAdded', sftoolgui.FitEventData( hFitdev ));
Error in sftool_v1 (line 72)
h.HFitsManager.newFit( data );
Error in cftool>iStartSFTOOL (line 51)
application = sftool_v1( varaibles, names );
Error in cftool (line 41)
theApplication = iStartSFTOOL( varargin, names );
Error in LiveEditorEvaluationHelperE1999554706 (line 8)
cftool(xvals,yvals)
Error in matlab.internal.editor.evaluateRegions
Error in matlab.internal.editor.EvaluationOutputsService.evalRegions
Strangely, when I use the command f=fit(xvals,yvals,'poly2') it works. Why does the curve fitting toolbox doesn't open?

回答(1 个)

Priyanshu Mishra
Priyanshu Mishra 2020-2-27
Hi Luca,
It seems you have used script name as any of the MATLAB function. Try to rename the script (other than MATLAB keyword) and run it again.

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by