matlab中regress怎么用不对?
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/01 12:59:23
matlab中regress怎么用不对?
>> 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.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.
请问出现这个问题为什么?
看一下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') .
matlab中regress怎么用不对?
MATLAB中regress的问题
matlab regress.
MATLAB中关于regress函数的问题
matlab中的regress函数.
matlab中的regress函数到底怎么做的呢?
matlab regress 用法 此题怎么解 多元线性回归
求Matlab中regress函数的源程序代码
MATLAB中多元线性回归命令 (除了regress)
MATLAB 用regress函数的二元线性拟合
matlab 中 regress函数警告:Warning: X is rank deficient to within
matlab 多元线性回归 函数regress 求救