qiumo2003ooo
2012-06-25, 11:18
建立ct.m
function y=ct(x)
y=x(1)*exp(-x(2)*t)
建立exam.m
t=[0.25 0.5 1 1.5 2 3 4 6 8];
c=[19.21 18.15 15.36 14.1 12.89 9.32 7.45 5.24 3.01];
x0=[10,0.5];
x=lsqcurvefit(@ct,x0,t,c)
tt=0:0.2:8;
yy=x(1)*exp(-x(2)*tt);
plot(tt,yy,t,c,'rp')
function y=ct(x)
y=x(1)*exp(-x(2)*t)
建立exam.m
t=[0.25 0.5 1 1.5 2 3 4 6 8];
c=[19.21 18.15 15.36 14.1 12.89 9.32 7.45 5.24 3.01];
x0=[10,0.5];
x=lsqcurvefit(@ct,x0,t,c)
tt=0:0.2:8;
yy=x(1)*exp(-x(2)*tt);
plot(tt,yy,t,c,'rp')