Curve Fitting Using Outside Parameter

14 ビュー (過去 30 日間)
Saeid
Saeid 2017 年 12 月 15 日
回答済み: Torsten 2017 年 12 月 15 日
I am trying to find a fit to a set of (X,Y) data where X varies between 0.001 & 1000 and the form of the fit functions is as shown in the FitFun below:
n=-0.3;
FitOpt=fitoptions('Method','NonlinearLeastSquares',...
'lower',[1*max(Y) 0 1],...
'upper',[50*max(Y) 3 2])
FitFun=fittype('(Y0*(1+(X0*X)^a))^((n-1)/a)',...
'dependent',{'Y'},'independent',{'X'},...
'coefficients',{'Y0','X0','a'});
When I run the script I get the message:
Conversion to cellstr from double is not possible.
It looks like the fit function cannot accept n as an outside parameter. How can I solve this problem?

回答 (1 件)

Torsten
Torsten 2017 年 12 月 15 日
Use ...'problem','n'... in the FitType structure and set "n" to a value in the call to "fit".
Best wishes
Torsten.

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by