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 Comments

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?
The parameter d is redundant because it is always multiplied by some other parameter. You could set it to 1.

Sign in to comment.

Answers (0)

Categories

Asked:

on 5 Apr 2011

Community Treasure Hunt

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

Start Hunting!