How can I solve this equation(nonlinear) ?

1 view (last 30 days)
Hello I want to solve this equation with Matlab but I have some problem.Please help to me for solving this equation.Finally I should find β,aR,KR,R2 values.
f(qe,ye)
β,aR,KR are constant
%qe=[1.48 4.11 3.72 7.11 9.71 10.76 ];
%Ce=[2.57 9.40 31.38 34.41 51.45 146.20 ];
xdata=[2.57 9.40 31.38 34.41 51.45 146.20];
ydata=[1.48 4.11 3.72 7.11 9.71 10.76 ];
x0 =[1;10;100];
[x, resnorm]= lsqcurvefit(@hadifun,x0,xdata,ydata)
"Error
>> nonlinear
Error using lsqcurvefit (line 248)
Function value and YDATA sizes are not equal.
Error in nonlinear (line 6)
[x, resnorm]= lsqcurvefit(@hadifun,x0,xdata,ydata)"
function F = hadifun(x,xdata)
F = (x(1)*xdata)/(1+((x(2)*xdata.^(x(3)))));
end
"Error
>> hadifun
Error using hadifun (line 2)
Not enough input arguments. "

Accepted Answer

Matt J
Matt J on 29 Mar 2015
Looks like you need dot-division,
F = (x(1)*xdata)./(1+((x(2)*xdata.^(x(3)))));

More Answers (1)

matstudent
matstudent on 29 Mar 2015
Thanks all of you. I've recently started.

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!