matlab中,关于多元函数的拟合问题已知x1={104020 104040 102900 103310 95855 98998 104174 99824 97708 100133 96785}x2={31.206 31.213 30.87 30.994 28.757 29.699 31.251 29.947 29.312 30.04 29.035} x3={83.216 83.234 82.319 82.651 76.684 79.198

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 09:16:58

matlab中,关于多元函数的拟合问题已知x1={104020 104040 102900 103310 95855 98998 104174 99824 97708 100133 96785}x2={31.206 31.213 30.87 30.994 28.757 29.699 31.251 29.947 29.312 30.04 29.035} x3={83.216 83.234 82.319 82.651 76.684 79.198
matlab中,关于多元函数的拟合问题
已知x1={104020 104040 102900 103310 95855 98998 104174 99824 97708 100133 96785}
x2={31.206 31.213 30.87 30.994 28.757 29.699 31.251 29.947 29.312 30.04 29.035}
x3={83.216 83.234 82.319 82.651 76.684 79.198 83.335 79.859 78.166 80.105 77.428}
Y={26.676 26.953 26.103 26.152 28.318 26.879 27.413 27.886 27.736 26.452 27.957}
怎么用matlab拟合出f(x1,x2,x3)来

matlab中,关于多元函数的拟合问题已知x1={104020 104040 102900 103310 95855 98998 104174 99824 97708 100133 96785}x2={31.206 31.213 30.87 30.994 28.757 29.699 31.251 29.947 29.312 30.04 29.035} x3={83.216 83.234 82.319 82.651 76.684 79.198
模型选为:y=b0+b1*x1+b2*x2+b3*x3.代码:
X0=ones(11,1);
X1=[104020 104040 102900 103310 95855 98998 104174 99824 97708 100133 96785]';
X2=[31.206 31.213 30.87 30.994 28.757 29.699 31.251 29.947 29.312 30.04 29.035]';
X3=[83.216 83.234 82.319 82.651 76.684 79.198 83.335 79.859 78.166 80.105 77.428]';
X=[X0 X1 X2 X3];
Y=[26.676 26.953 26.103 26.152 28.318 26.879 27.413 27.886 27.736 26.452 27.957];
[b,bint,r,rint,stats]=regress(Y,X)
其中,b输出一个向量,分别是b0 b1 b2 b3的值.代入模型即可.