why do I see error in curve fitting?

조회 수: 8 (최근 30일)
MP
MP 2021년 12월 16일
댓글: Walter Roberson 2021년 12월 17일
What I try to run the below example given under the link : https://in.mathworks.com/help/curvefit/fit.html
clear; close all; clc;
load census;
f=fit(cdate,pop,'poly2');
plot(f,cdate,pop);
it throws following error...
Unable to resolve the name curvefit.attention.Error.
Error in fit>iCreateErrorFunction (line 631)
errorFcn = curvefit.attention.Error();
Error in fit (line 107)
errorFcn = iCreateErrorFunction( nargout > 4 );
Can anyone please help?
  댓글 수: 3
MP
MP 2021년 12월 16일
>> which fit
C:\Program Files\MATLAB\R2021a\toolbox\curvefit\curvefit\fit.m
MP
MP 2021년 12월 16일
The curve fitting toolbox is located at C:\Program Files\MATLAB\R2021a\toolbox\curvefit\curvefit\fit.m
still it gives following error.
Error using cfit
'fittype' requires Curve Fitting Toolbox.
Error in fit>iFit (line 128)
fitobj = cfit;
Error in fit (line 116)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ...

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2021년 12월 16일
The Curve Fitting Toolbox needs to be reinstalled.
  댓글 수: 4
MP
MP 2021년 12월 17일
편집: MP 2021년 12월 17일
Thank you for the clarification..
How about the other way round? I have 2017 matlab too.. Can I Copy-Paste 2017 toolbox to 2021 matlab folder and then add to 2021matlab path?
Walter Roberson
Walter Roberson 2021년 12월 17일
It is possible for that message to show up if you have the Curve Fitting Toolbox installed, but somehow do not have a license to use it.
For individual licenses, it is typically only possible to install toolboxes you have a license for, but there are some situations in which it is possible.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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