matlab中regress怎么用不对???

2024-12-27 21:41:59
推荐回答(2个)
回答1:

看一下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') 。

回答2:

regress(y',x1')