Hi,
Im trying to fit a model i've made to some experimental data, however I'm getting an error i don't seem to understand.
I followed the fittype guide.
Heres my code:
function pdf = pdf_GG(Var)
I=0.3;
LKK = sqrt(Var);
alpha = (exp((5.19.*LKK.^2)./((1 + 9.01.*LKK.^(12/5)).^(7/6))) -1).^-1;
beta = (exp((6.22.*LKK.^2)./((1 + 22.39.*LKK.^(12/5)).^(5/6))) -1).^-1;
k = (alpha+beta)./2;
k1 = alpha.*beta;
H =4.*(k1.^k)./(gamma(alpha).*gamma(beta));
H1 = I.^(k-1);
D = 6.*sqrt(k1.*I);
pdf = H.*H1.*besselk((alpha-beta),D);
And now my main code:
x0=[0.2];
fitfun=fittype(@(Var) pdf_GG( Var),'independent','Var');
[fitted_curve,gof]=fit(ctrs',pn',fitfun,'StartPoint',x0);
Any help on how i should proceed to make this fit?Thank you very much
3 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1101174
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1101174
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1105104
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1105104
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1110880
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/632309-fitting-model-this-expression-has-no-coefficients-or-non-scalar-coefficients#comment_1110880
Sign in to comment.