How can I solve this equation(nonlinear) ?

1 visualizzazione (ultimi 30 giorni)
matstudent
matstudent il 29 Mar 2015
Risposto: matstudent il 29 Mar 2015
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. "

Risposta accettata

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

Più risposte (1)

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

Categorie

Scopri di più su Systems of Nonlinear Equations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by