看一下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') 。
regress(y',x1')