请问matlab中nlinfit拟合函数怎么用
>>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];>>y=[30,68...
>> 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];
>> y = [30,68,75,82,82,77,68,68,58,51,50,41,38,35,28,25,18,15,12,10,7,7,4];
拟合出k1,k2,k3,函数是这样的: 展开
>> y = [30,68,75,82,82,77,68,68,58,51,50,41,38,35,28,25,18,15,12,10,7,7,4];
拟合出k1,k2,k3,函数是这样的: 展开
2个回答
展开全部
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];
y = [30,68,75,82,82,77,68,68,58,51,50,41,38,35,28,25,18,15,12,10,7,7,4];
mf=@(cs,t1)cs(1)*cs(3)/(cs(1)-cs(2))*(exp(-cs(2)*t1)-exp(-cs(1)*t1));
c=lsqcurvefit(mf,rand(3,1),t,y)
mf1=c(1)*c(3)/(c(1)-c(2))*(exp(-c(2)*t)-exp(-c(1)*t));
plot(t,y,'r*',t,mf1)
y = [30,68,75,82,82,77,68,68,58,51,50,41,38,35,28,25,18,15,12,10,7,7,4];
mf=@(cs,t1)cs(1)*cs(3)/(cs(1)-cs(2))*(exp(-cs(2)*t1)-exp(-cs(1)*t1));
c=lsqcurvefit(mf,rand(3,1),t,y)
mf1=c(1)*c(3)/(c(1)-c(2))*(exp(-c(2)*t)-exp(-c(1)*t));
plot(t,y,'r*',t,mf1)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询