Solving for 2 unknowns with nonlinear regression
Afficher commentaires plus anciens
I am having trouble setting up my nonlinear fit because I can't figure out how to write the model equation. I keep getting a parse error. Seems like such a simple fix, but it has been persistent.
Cc=[1, 1.39, 1.93, 2.66 ,3.7 , 7.12, 13.7];
Cs=[250, 245, 238, 229, 216, 197, 94.4];
dC=[.30, .45, .63, .87, 1.21, 2.32, 4.42]';
CC=Cc.*Cs;
x=[CC' Cs'];
model=@(b,x) ( x(:,1).*b(1). )/ ( x(:,2).+ b(2).);
initial=[1,1];
[beta,r,j,covb,mse]=nlinfit(x,dC,model,initial)
is nonlin fit not the right way to go about this?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Linear Regression dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!