matlab程序出错,M文件程序:function y=li4_15fun(beta,x)b1=beta(1);b2=beta(2);b3=beta(3);b4=beta(4);b5=beta(5);b6=beta(6);x1=x(:,1);x2=x(:,2);y=b1*x1+b2*x2+b3*x1*x2+b4*x1^2+b5*x2^2+b6;实现MATLAB程序代码:x=[101 98.4 98.8 98.5 98.6 98.3
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 12:41:58
matlab程序出错,M文件程序:function y=li4_15fun(beta,x)b1=beta(1);b2=beta(2);b3=beta(3);b4=beta(4);b5=beta(5);b6=beta(6);x1=x(:,1);x2=x(:,2);y=b1*x1+b2*x2+b3*x1*x2+b4*x1^2+b5*x2^2+b6;实现MATLAB程序代码:x=[101 98.4 98.8 98.5 98.6 98.3
matlab程序出错,
M文件程序:
function y=li4_15fun(beta,x)
b1=beta(1);
b2=beta(2);
b3=beta(3);
b4=beta(4);
b5=beta(5);
b6=beta(6);
x1=x(:,1);
x2=x(:,2);
y=b1*x1+b2*x2+b3*x1*x2+b4*x1^2+b5*x2^2+b6;
实现MATLAB程序代码:
x=[101 98.4 98.8 98.5 98.6 98.3 98.2 98.8 ...
99.2 99.5 100.6 101.9 101.5 102.7 102.4 ...
102.8 103.1 102.9 103.3 103.5 103.6 104.4 ...
105.1 104.6 104.9 104.9 105.4 105.3 105.5 ...
106.4 106.5 106.2 106.1 105.5 104.2 104.1 ...
104.5 103.2 103.6 103.4 103 102.2 101.8 ;...
496135.31 506708.07 530626.71 540481.21 548263.51 ...
568916.2 573102.85 576698.95 576698.95 586643.29 ...
594604.72 610224.52 625609.29 636072.26 649947.46 ...
656561.22 663351.37 673921.72 674051.48 687506.92 ...
696471.5 699776.74 710339.03 725851.79 733884.83 ...
736130.86 758130.88 757384.56 763409.22 780820.85 ...
772923.65 780852.3 787406.2 816829.25 825493.94 ...
851590.9 855898.89 867177.63 895600 889600 900000 ...
925000 919100]';
y=[6.903106371 7.225626957 8.235698339 8.568031143 9.05741188 ...
10.11868304 11.53129484 9.041437382 9.371831192 10.11122581 ...
10.83773227 11.08377391 10.10374405 10.33224172 10.57647004 ...
9.668508381 8.66274477 7.931443768 7.811012294 7.725546848 ...
7.753376076 8.716879521 8.187910629 8.159126617 8.164803424 ...
8.5153187 8.592566071 8.616842178 7.977995117 7.960922453 ...
7.722893902 7.343536235 6.759000182 7.07908152 6.683803196 ...
6.322854775 6.596952109 7.004311494 6.512667438 6.8909743 ...
6.786185408 6.329736591 5.96885781]';
beta0=[1 1 1 1 1 1]';
[beta,R,J]=nlinfit(x,y,@li4_15fun,beta0);
matlab程序出错,M文件程序:function y=li4_15fun(beta,x)b1=beta(1);b2=beta(2);b3=beta(3);b4=beta(4);b5=beta(5);b6=beta(6);x1=x(:,1);x2=x(:,2);y=b1*x1+b2*x2+b3*x1*x2+b4*x1^2+b5*x2^2+b6;实现MATLAB程序代码:x=[101 98.4 98.8 98.5 98.6 98.3
y=b1*x1+b2*x2+b3*x1*x2+b4*x1^2+b5*x2^2+b6;%向量运算搞清楚点乘.*还是*
改成y=b1.*x1+b2.*x2+b3.*x1.*x2+b4.*x1.^2+b5.*x2.^2+b6;