matlab非线性数据拟合数据是这样的:x =5 10 20 50 100 120 150 200 250 300y =526.9253 891.0675 1304.9097 1975.3134 2515.8623 2491.0713 689.7942 2741.6093 2715.6158 2822.6647下面是我编的程序:clear;clc;clf;x1=xlsread('低浓度绿分
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 14:18:07
matlab非线性数据拟合数据是这样的:x =5 10 20 50 100 120 150 200 250 300y =526.9253 891.0675 1304.9097 1975.3134 2515.8623 2491.0713 689.7942 2741.6093 2715.6158 2822.6647下面是我编的程序:clear;clc;clf;x1=xlsread('低浓度绿分
matlab非线性数据拟合
数据是这样的:
x =5 10 20 50 100 120 150 200 250 300
y =526.9253 891.0675 1304.9097 1975.3134 2515.8623 2491.0713 689.7942 2741.6093 2715.6158 2822.6647
下面是我编的程序:
clear;
clc;
clf;
x1=xlsread('低浓度绿分量拟合曲线.xls','sheet1','a3:a12');
y1=xlsread('低浓度绿分量拟合曲线.xls','sheet1','d3:d12');
x=x1'
y=y1'
% [P,S]=polyfit(x,y,8)
% plot(x,y,'k*',x,polyval(P,x),'k-');
fun=@(a,x) (a(1)+a(2)*x.^0.5).^0.5;
beta=nlinfit(x,y,fun,[1 1]); % nlinfit 非线性最小二乘数据拟合(牛顿法)
a=beta(1),b=beta(2)
X=0:300;
Y=(a+b*X.^0.5).^0.5;
plot(x,y,'o',X,Y);
试过了,用多项式拟合的效果不好.但是用nlinfit拟合的话,我不知道怎样建模型,上面那个模型(a(1)+a(2)*x.^0.5).^0.5是瞎蒙的,效果凑合.
模型应该怎么建啊?
matlab非线性数据拟合数据是这样的:x =5 10 20 50 100 120 150 200 250 300y =526.9253 891.0675 1304.9097 1975.3134 2515.8623 2491.0713 689.7942 2741.6093 2715.6158 2822.6647下面是我编的程序:clear;clc;clf;x1=xlsread('低浓度绿分
推荐这个模型比较好.
General model Exp2:
f(x) = a*exp(b*x) + c*exp(d*x)
Coefficients (with 95% confidence bounds):
a = 2524 (2265,2783)
b = 0.0003625 (-8.025e-005,0.0008052)
c = -2244 (-2487,-2001)
d = -0.02828 (-0.03697,-0.01959)
Goodness of fit:
SSE:2.165e+004
R-square:0.9967
Adjusted R-square:0.995
RMSE:60.07
用cftool找模型,用法:
>> cftool
回车后,出现对话框,自己能看懂.对了对应x=150的那个值好像是2689.7942 而不是689.7942