matlab中: The number of rows in Y must equal the number of ro

问题描述:

matlab中: The number of rows in Y must equal the number of rows in X.?
x1=[2.98,2.89,2.82,3.14,3.56,3.98,4.87,5.12,6.00,6.01];
x2=[6280,6860,7703,8472,9422,10493,11760,13786,15781,17175];
y=[950,848,879,815,775,681,685,715,749,728,];
[b,bnt,r,rint,stats]=regress(y,x)
? Error using ==> regress
The number of rows in Y must equal the number of rows in X.
1个回答 分类:综合 2014-12-08

问题解答:

我来补答
x1=[2.98,2.89,2.82,3.14,3.56,3.98,4.87,5.12,6.00,6.01];
x2=[6280,6860,7703,8472,9422,10493,11760,13786,15781,17175];
y1=[950,848,879,815,775,681,685,715,749,728,];
>> x=[ones(length(x1),1) x1' x2'];
>> y=y1';
>> [b,bnt,r,rint,stats]=regress(y,x)
b =
970.4834
-11.4316
-0.0131
bnt =
1.0e+003 *
0.7569 1.1841
-0.2373 0.2144
-0.0001 0.0001
r =
95.5954
0.1410
41.3498
-8.9494
-31.7418
-106.9540
-76.2337
-16.9176
53.1956
50.5146
rint =
-1.3064 192.4973
-158.7583 159.0403
-98.9889 181.6886
-165.2191 147.3203
-195.4387 131.9551
-242.2455 28.3376
-193.1508 40.6835
-180.2022 146.3670
-79.2291 185.6203
-64.2202 165.2495
stats =
1.0e+003 *
0.0005 0.0037 0.0001 4.9792
 
 
展开全文阅读
剩余:2000
上一页:100 ,11
下一页:29