matlab中regress怎么用不对???
>>x1=[66.29040.96472.99645.01057.20426.85238.12235.84075.796]x1=66.290040.964072.9960...
>> x1=[66.290 40.964 72.996 45.010 57.204 26.852 38.122 35.840 75.796]
x1 =
66.2900 40.9640 72.9960 45.0100 57.2040 26.8520 38.1220 35.8400 75.7960
>> y=[196 63 252 84 126 14 49 49 266]
y =
196 63 252 84 126 14 49 49 266
>> [b,bint,r,rint,stats]=regress(y,x1)
??? Error using ==> regress
The number of rows in Y must equal the number of rows in X.
请问出现这个问题为什么??? 展开
x1 =
66.2900 40.9640 72.9960 45.0100 57.2040 26.8520 38.1220 35.8400 75.7960
>> y=[196 63 252 84 126 14 49 49 266]
y =
196 63 252 84 126 14 49 49 266
>> [b,bint,r,rint,stats]=regress(y,x1)
??? Error using ==> regress
The number of rows in Y must equal the number of rows in X.
请问出现这个问题为什么??? 展开
2个回答
展开全部
看一下regress的帮助文件: B = REGRESS(Y,X) returns the vector B of regression coefficients in thelinear model Y = X*B.
X is an n-by-p design matrix, with rowscorresponding to observations and columns to predictor variables.
Y isan n-by-1 vector of response observations.
它要求X是n*p阶矩阵,而Y为n*1向量,你的应该改成regress(y',x1') 。
X is an n-by-p design matrix, with rowscorresponding to observations and columns to predictor variables.
Y isan n-by-1 vector of response observations.
它要求X是n*p阶矩阵,而Y为n*1向量,你的应该改成regress(y',x1') 。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询