Solving for 2 unknowns with nonlinear regression
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!