用matlab做一个合适的回归模型,y:196,63,252,84,126,14,49,49,266,49,105,98,77,14,56,245,133,133x1:66.290,40.964,72.996,45.010,57.204,26.852,38.122,35.840,75.796,37.408,54.376,46.186,46.130,30.366,39.060,79.380,52.766,55.916x2:7,5,10,6,4,5,4,6
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 21:00:52
用matlab做一个合适的回归模型,y:196,63,252,84,126,14,49,49,266,49,105,98,77,14,56,245,133,133x1:66.290,40.964,72.996,45.010,57.204,26.852,38.122,35.840,75.796,37.408,54.376,46.186,46.130,30.366,39.060,79.380,52.766,55.916x2:7,5,10,6,4,5,4,6
用matlab做一个合适的回归模型,
y:196,63,252,84,126,14,49,49,266,49,105,98,77,14,56,245,133,133
x1:66.290,40.964,72.996,45.010,57.204,26.852,38.122,35.840,75.796,37.408,54.376,46.186,46.130,30.366,39.060,79.380,52.766,55.916
x2:7,5,10,6,4,5,4,6,9,5,2,7,4,3,5,1,8,6
x1与y 存在着二次关系,x2对y有线性关系.
通过那些数据建立一个合适的回归模型,
哪位高手会的麻烦你把要在MATLAB输入的代码和结果转上来
先谢过了
用matlab做一个合适的回归模型,y:196,63,252,84,126,14,49,49,266,49,105,98,77,14,56,245,133,133x1:66.290,40.964,72.996,45.010,57.204,26.852,38.122,35.840,75.796,37.408,54.376,46.186,46.130,30.366,39.060,79.380,52.766,55.916x2:7,5,10,6,4,5,4,6
clear;clc;
y=[...
196,63,252,84,126,14,49,49,266,49,105,98,77,14,56,245,133,133 ];
x1=[
66.290,40.964,72.996,45.010,57.204,26.852,38.122,35.840,75.796,37.408,54.376,46.186,46.130,30.366,39.060,79.380,52.766,55.916 ];
x2=[7,5,10,6,4,5,4,6,9,5,2,7,4,3,5,1,8,6 ];
a=polyfit(x1,y,2)
b=polyfit(x2,y,1)
f1=vpa(poly2sym(a,'x'),4)
f2=vpa(poly2sym(b,'x'),4)
结果:
a =
0.0302 1.7886 -60.5239
b =
13.5218 38.7434
f1 =
.3025e-1*x^2+1.789*x-60.52
f2 =
13.52*x+38.74
>>
楼主怎么没悬赏分啊?怪不得没人做.唉,看到MATLAB题目就冲动,就做回好人吧,