Curve fitting in a for loop
显示 更早的评论
I have a system of difference equations expressed in a for loop. I have experimental data that I would like to fit some parameters to. Could anyone provide some insight into how to proceed. I've experimented with lsqnonlin, lsqcurvefit, and fminsearch to no avail.
parameters to fit: c(1,2,3)
parameters to fix: b,d,KX1,KX2,KX3
system:
for t=1:9
CtlA(t)=X1(t) + X2(t) + X3(t);
X1(t+1)=b*X3(t);
X2(t+1)=X1(t)/((1+c(1)*CtlA(t))*KX1*d);
X3(t+1)=(X2(t)/((1+c(2)*CtlA(t))*KX2*d))+(X3(t)/((1+c(3)*CtlA(t))*KX3*d));
end
Any help would be gladly appreciated!
2 个评论
Andrew Newell
2011-4-5
This for loop seems to have X1, X2 and X3 as both input and output. Are they the data? Are you trying to fit them to some function of t?
Andrew Newell
2011-4-5
The parameter d is redundant because it is always multiplied by some other parameter. You could set it to 1.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!