t=[0.25,0.5,0.75,1,1.5,2,2.5,3,3.5,4,4.5,5,6,7,8,9,10,11,12,13,14,15,16];
C=[30,68,75,82,82,77,68,68,58,51,50,41,38,35,28,25,18,15,12,10,7,7,4];
f=inline(\'k(3)*(k(1)/(k(1)-k(2))*(exp(-k(2)*t)-exp(-k(1)*t))\',\'k\',\'t\');
[k,res]=lsqcurvefit(f,[1,0,82],t,C);
??? Error using == optim\\private\\lsqncommon
User supplied expression or inline function == k(3)*(k(1)/(k(1)-k(2))*(exp(-k(2)*t)-exp(-k(1)*t))
failed with the following error:
Error using == inlineeval
Error in inline expression == k(3)*(k(1)/(k(1)-k(2))*(exp(-k(2)*t)-exp(-k(1)*t))
??? Error: Missing variable or function.
Error in == lsqcurvefit at 149
[x,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...
为什么会出现这样的问题啊?应该怎么修改!
|