matlab 两个变量 拟合公式 20
X1=[10151821222730101518212227301015182122273010151821222730];X2=[4604460446044604460...
X1=[10 15 18 21 22 27 30 10 15 18 21 22 27 30 10 15 18 21 22 27 30 10 15 18 21 22 27 30];
X2=[4604 4604 4604 4604 4604 4604 4604 4000 4000 4000 4000 4000 4000 4000 3000 3000 3000 3000 3000 3000 3000 2000 2000 2000 2000 2000 2000 2000];
Y=[1.9 7.1 13.3 23.1 27.4 58.9 87.6 1.7 6.2 11.7 20.3 24 51.6 51.6 76.8 1.3 4.8 9 15.6 18.4 39.6 58.9 0.9 3.3 6.3 10.9 12.8 27.6 41];
请帮忙拟合一下,谢谢 展开
X2=[4604 4604 4604 4604 4604 4604 4604 4000 4000 4000 4000 4000 4000 4000 3000 3000 3000 3000 3000 3000 3000 2000 2000 2000 2000 2000 2000 2000];
Y=[1.9 7.1 13.3 23.1 27.4 58.9 87.6 1.7 6.2 11.7 20.3 24 51.6 51.6 76.8 1.3 4.8 9 15.6 18.4 39.6 58.9 0.9 3.3 6.3 10.9 12.8 27.6 41];
请帮忙拟合一下,谢谢 展开
2个回答
展开全部
X1=[10 15 18 21 22 27 30 10 15 18 21 22 27 30 10 15 18 21 22 27 30 10 15 18 21 22 27 30]';
X2=[4604 4604 4604 4604 4604 4604 4604 4000 4000 4000 4000 4000 4000 4000 3000 3000 3000 3000 3000 3000 3000 2000 2000 2000 2000 2000 2000 2000]';
Y=[1.9 7.1 13.3 23.1 27.4 58.9 87.6 1.7 6.2 11.7 20.3 24 51.6 51.6 76.8 1.3 4.8 9 15.6 18.4 39.6 58.9 0.9 3.3 6.3 10.9 12.8 27.6]';
e=ones(28,1);
x=[e,X1,X2];
[b,bint,r,rint,stats]=regress(Y,x,0.05);
rcoplot(r,rint);
运行后
b =
-18.0636
1.2827
0.0047
所以Y = -18.0636 + 1.2827X1 + 0.0047X2;
Y好像多了一个值,我把最后一个值41去掉了
X2=[4604 4604 4604 4604 4604 4604 4604 4000 4000 4000 4000 4000 4000 4000 3000 3000 3000 3000 3000 3000 3000 2000 2000 2000 2000 2000 2000 2000]';
Y=[1.9 7.1 13.3 23.1 27.4 58.9 87.6 1.7 6.2 11.7 20.3 24 51.6 51.6 76.8 1.3 4.8 9 15.6 18.4 39.6 58.9 0.9 3.3 6.3 10.9 12.8 27.6]';
e=ones(28,1);
x=[e,X1,X2];
[b,bint,r,rint,stats]=regress(Y,x,0.05);
rcoplot(r,rint);
运行后
b =
-18.0636
1.2827
0.0047
所以Y = -18.0636 + 1.2827X1 + 0.0047X2;
Y好像多了一个值,我把最后一个值41去掉了
更多追问追答
追问
对不住,Y=[1.9 7.1 13.3 23.1 27.4 58.9 87.6 1.7 6.2 11.7 20.3 24 51.6 76.8 1.3 4.8 9 15.6 18.4 39.6 58.9 0.9 3.3 6.3 10.9 12.8 27.6 41];拟合的第一个就不满足吧
追答
将Y更换后
b =
-63.2236
3.1882
0.0064
Y = -63.2236 + 3.1882X1 + 0.0064X2;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询