matlab数据拟合经验公式:y=a/(1+(a/667.5-1)*exp(b*x))y=[667.5687.6717.4728.3761.6771.38789109991006.41003.21007.61013.31014.31019.510291050.61069.31069.610851104.911291189.61203.21209.31219.71234.11253.51334.61376.6
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 02:51:20
matlab数据拟合经验公式:y=a/(1+(a/667.5-1)*exp(b*x))y=[667.5687.6717.4728.3761.6771.38789109991006.41003.21007.61013.31014.31019.510291050.61069.31069.610851104.911291189.61203.21209.31219.71234.11253.51334.61376.6
matlab数据拟合
经验公式:y=a/(1+(a/667.5-1)*exp(b*x))
y=[667.5687.6717.4728.3761.6771.38789109991006.41003.21007.61013.31014.31019.510291050.61069.31069.610851104.911291189.61203.21209.31219.71234.11253.51334.61376.61383.2];
x=[12345678910111213141516171819202122232425262728293031];
希望能给出图像,a,b,给出具体做法
matlab数据拟合经验公式:y=a/(1+(a/667.5-1)*exp(b*x))y=[667.5687.6717.4728.3761.6771.38789109991006.41003.21007.61013.31014.31019.510291050.61069.31069.610851104.911291189.61203.21209.31219.71234.11253.51334.61376.6
clc;
clear;
x=1:31;
y=[667.5687.6717.4728.3761.6771.38789109991006.41003.21007.61013.31014.31019.510291050.61069.31069.610851104.911291189.61203.21209.31219.71234.11253.51334.61376.61383.2];
fun=inline('k(1)./(1+(k(1)/667.5-1)*exp(k(2).*x))','k','x');
beta=nlinfit(x,y,fun,[1000 0.8]);%迭代的初始值,大概给个值.
k=beta;
x1=1:0.2:31;
x_fit=k(1)./(1+(k(1)./667.5-1)*exp(k(2).*x1));
plot(x,y,'+',x1,x_fit);
legend('原数据点','拟合曲线');
xlabel 'X';
ylabel 'Y';
a=beta(1)
b=beta(2)