matlab中怎样用幂函数拟合方程
有三个函数,通过excel和minitab作图观察感觉可以用幂函数拟合。求拟合方程。y=a+b/x^c,最好能给出程序及回归模型。--------------------...
有三个函数,通过excel和minitab作图观察感觉可以用幂函数拟合。求拟合方程。
y=a+b/x^c,最好能给出程序及回归模型。
---------------------------------------------
第一组为:
x=6.69:0.02:7.53;
y=[4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
plot(x,y,'+')
---------------------------------------------
第二组为:
x=6.69:0.02:7.53;
y=[10.2,9.08,8.15,7.3,6.5,5.82,5.19,4.64,4.15,3.72,3.33,2.97,2.65,2.37,2.12,1.9,1.7,1.52,1.36,1.21,1.08,0.97,0.865,0.775,0.69,0.62,0.553,0.493,0.442,0.395,0.353,0.315,0.283,0.253,0.225,0.201,0.18,0.161,0.144,0.129,0.115,0.103,0.092];
plot(x,y,'+')
---------------------------------------------
第三组为:
x=6.69:0.02:7.53;
y=[17.6,15.7,14.1,12.6,11.2,10.1,9.08,8.1,7.21,6.5,5.8,5.21,4.65,4.17,3.73,3.35,2.99,2.69,2.41,2.15,1.93,1.73,1.54,1.38,1.24,1.11,0.99,0.89,0.795,0.71,0.635,0.57,0.51,0.458,0.409,0.365,0.327,0.293,0.262,0.235,0.21,0.188,0.169];
plot(x,y,'+')
谢谢。 展开
y=a+b/x^c,最好能给出程序及回归模型。
---------------------------------------------
第一组为:
x=6.69:0.02:7.53;
y=[4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
plot(x,y,'+')
---------------------------------------------
第二组为:
x=6.69:0.02:7.53;
y=[10.2,9.08,8.15,7.3,6.5,5.82,5.19,4.64,4.15,3.72,3.33,2.97,2.65,2.37,2.12,1.9,1.7,1.52,1.36,1.21,1.08,0.97,0.865,0.775,0.69,0.62,0.553,0.493,0.442,0.395,0.353,0.315,0.283,0.253,0.225,0.201,0.18,0.161,0.144,0.129,0.115,0.103,0.092];
plot(x,y,'+')
---------------------------------------------
第三组为:
x=6.69:0.02:7.53;
y=[17.6,15.7,14.1,12.6,11.2,10.1,9.08,8.1,7.21,6.5,5.8,5.21,4.65,4.17,3.73,3.35,2.99,2.69,2.41,2.15,1.93,1.73,1.54,1.38,1.24,1.11,0.99,0.89,0.795,0.71,0.635,0.57,0.51,0.458,0.409,0.365,0.327,0.293,0.262,0.235,0.21,0.188,0.169];
plot(x,y,'+')
谢谢。 展开
4个回答
展开全部
直接使用CFTOOL工具箱
命令行输入cftool即可,然后选择拟合类型
x=[6.69:0.02:7.53];
y=[4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
直接输入cftool进入曲线拟合工具箱界面“Curve Fitting tool”
(1)点击“Data”按钮,弹出“Data”窗口;
(2)利用X data和Y data的下拉菜单读入数据x,y,然后点击“Create data set”按钮,退出“Data”窗口,返回工具箱界面,这时会自动画出数据集的曲线图;
(3)点击“Fitting”按钮,弹出“Fitting”窗口;
(4)点击“New fit”按钮,可修改拟合项目名称“Fit name”,通过“Data set”下拉菜单选择数据集,然后通过下拉菜单“Type of fit”选择拟合曲线的类型,选择类型Power:幂逼近,有2种类型,a*x^b 、a*x^b + c
命令行输入cftool即可,然后选择拟合类型
x=[6.69:0.02:7.53];
y=[4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
直接输入cftool进入曲线拟合工具箱界面“Curve Fitting tool”
(1)点击“Data”按钮,弹出“Data”窗口;
(2)利用X data和Y data的下拉菜单读入数据x,y,然后点击“Create data set”按钮,退出“Data”窗口,返回工具箱界面,这时会自动画出数据集的曲线图;
(3)点击“Fitting”按钮,弹出“Fitting”窗口;
(4)点击“New fit”按钮,可修改拟合项目名称“Fit name”,通过“Data set”下拉菜单选择数据集,然后通过下拉菜单“Type of fit”选择拟合曲线的类型,选择类型Power:幂逼近,有2种类型,a*x^b 、a*x^b + c
展开全部
以第一个为例:
1、在命令行输入数据:
x=6.69:0.02:7.53;
y=4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
2、启动曲线拟合工具箱
>>cftool
3、进入曲线拟合工具箱界面“Curve Fitting tool”
(1)点击“Data”按钮,弹出“Data”窗口;
(2)利用X data和Y data的下拉菜单读入数据x,y,可修改数据集名“Data set name”,然后点击“Create data set”按钮,退出“Data”窗口,返回工具箱界面,这时会自动画出数据集的曲线图;
(3)点击“Fitting”按钮,弹出“Fitting”窗口;
(4)点击“New fit”按钮,可修改拟合项目名称“Fit name”,通过“Data set”下拉菜单选择数据集,然后通过下拉菜单“Type of fit”选择拟合曲线的类型,工具箱提供的拟合类型有:
Custom Equations:用户自定义的函数类型Power:幂逼近,有2种类型,a*x^b 、a*x^b + c在本例中选Power,即可得到拟合曲线。
1、在命令行输入数据:
x=6.69:0.02:7.53;
y=4.2,3.7,3.3,2.95,2.63,2.33,2.11,1.87,1.65,1.47,1.32,1.17,1.04,0.925,0.82,0.735,0.653,0.582,0.52,0.462,0.412,0.366,0.325,0.289,0.258,0.23,0.205,0.182,0.162,0.145,0.129,0.115,0.102,0.091,0.081,0.072,0.064,0.057,0.051,0.0455,0.0403,0.036,0.032];
2、启动曲线拟合工具箱
>>cftool
3、进入曲线拟合工具箱界面“Curve Fitting tool”
(1)点击“Data”按钮,弹出“Data”窗口;
(2)利用X data和Y data的下拉菜单读入数据x,y,可修改数据集名“Data set name”,然后点击“Create data set”按钮,退出“Data”窗口,返回工具箱界面,这时会自动画出数据集的曲线图;
(3)点击“Fitting”按钮,弹出“Fitting”窗口;
(4)点击“New fit”按钮,可修改拟合项目名称“Fit name”,通过“Data set”下拉菜单选择数据集,然后通过下拉菜单“Type of fit”选择拟合曲线的类型,工具箱提供的拟合类型有:
Custom Equations:用户自定义的函数类型Power:幂逼近,有2种类型,a*x^b 、a*x^b + c在本例中选Power,即可得到拟合曲线。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
回归模型需要你去查询相关书籍,好像是数据处理之类的书籍吧。
首先建立一个简单的m文件,然后你可以将每组的抽取一个数组,计算出相应的a,b,c,这样你可以求得(7.53-6.69)/0.02个a,b,c的值,然后将其求一下平均值。或者通过其余一些方法进行稍微拟合一下。
首先建立一个简单的m文件,然后你可以将每组的抽取一个数组,计算出相应的a,b,c,这样你可以求得(7.53-6.69)/0.02个a,b,c的值,然后将其求一下平均值。或者通过其余一些方法进行稍微拟合一下。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |