matlab急求大神帮忙!!!跪求大神帮忙做个多元线性规划的matlab模型。
x=[128453,102398,28774,90302,128.6,64.1,64.5;129227,116694,28559,90976,124.1,64.0,60....
x=[ 128453,102398,28774,90302,128.6,64.1,64.5;
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]';
x的各个列向量与y的关系,求源代码与结果。 展开
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]';
x的各个列向量与y的关系,求源代码与结果。 展开
2个回答
展开全部
>> X=[128453,102398,28774,90302,128.6,64.1,64.5;
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]';
b=regress(y,X)
Warning: X is rank deficient to within machine precision.
> In regress at 82
b =
1.0078
0.0000
-1.0074
-1.0084
-1.1377
0
1.7495
>> format long
>> b
b =
1.007801520858404
0.000030873005326
-1.007447292805085
-1.008387438210722
-1.137728205821926
0
1.749524312878069
%警告的意思是X各列之间有线性相关的,所以regress会自动将X将某些列的系数置为0,使剩下的列线性相关。
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]';
b=regress(y,X)
Warning: X is rank deficient to within machine precision.
> In regress at 82
b =
1.0078
0.0000
-1.0074
-1.0084
-1.1377
0
1.7495
>> format long
>> b
b =
1.007801520858404
0.000030873005326
-1.007447292805085
-1.008387438210722
-1.137728205821926
0
1.749524312878069
%警告的意思是X各列之间有线性相关的,所以regress会自动将X将某些列的系数置为0,使剩下的列线性相关。
更多追问追答
追问
还欠缺一个常数啊,能不能加q详谈啊,麻烦了
1761458052
追答
不一定非要有一个常数吧,这个模型就是
y=b(1)*x(:,1)+b(2)*x(:,2)+...+b(7)*x(:,7)
如果非要加个常数
b=regress(y,[X,ones(8,1)])%这样改了以后最后一个系数就是常数
展开全部
x=[ 128453,102398,28774,90302,128.6,64.1,64.5;
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]
y =
Columns 1 through 5
9377 9692 9857 10055 10419
Columns 6 through 8
10636 10956 11309
129227,116694,28559,90976,124.1,64.0,60.1;
129988,136515,27947,92184,122.9,64.2,58.7;
130756,182321,26504,94197,124.0,65.1,58.9;
131448,209407,25961,95068,120.9,68.1,52.8;
132129,246619,25660,95823,121.0,69.3,51.7;
132802,300670,25166,96681,121.4,70.6,50.8;
133474,335353,24663,97502,121.3,70.8,50.5];
y=[9377,9692,9857,10055,10419,10636,10956,11309]
y =
Columns 1 through 5
9377 9692 9857 10055 10419
Columns 6 through 8
10636 10956 11309
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询