用matlab中的最小二乘法拟合指数函x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];拟合一个月=1-exp(x/a)^2的函数 急用 最好上机实践下
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 20:48:18
用matlab中的最小二乘法拟合指数函x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];拟合一个月=1-exp(x/a)^2的函数 急用 最好上机实践下
用matlab中的最小二乘法拟合指数函
x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];
y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];
拟合一个月=1-exp(x/a)^2的函数 急用 最好上机实践下 急用
用matlab中的最小二乘法拟合指数函x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];拟合一个月=1-exp(x/a)^2的函数 急用 最好上机实践下
y-1=exp(x/a)^2
两边取对数,化成线性拟和
然后polyfit
function y=fun(b,x)
y=1-exp(x/b)^2
x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];
y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];
b0=[1];
[b,R,J]=nlinfit(x,y,'fun',b0);
bi=nlparci(b,R,J);
b,bi
x=[0.0712,0.0803,0.0264,0.0081,0.0242,0.0464,0.0247,0.0037,0.0036];
y=[0.1436,0.1495,0.1320,0.0424,0.0662,0.0439,0.0178,0.0188,0.0094];
b0=[1];
[b,R,J]=nlinfit(x,y,'fun',b0);
bi=nlparci(b,R,J);
b,