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.
请问出现这个问题为什么???
展开
 我来答
百度网友f40ec75
2010-08-27 · TA获得超过266个赞
知道答主
回答量:31
采纳率:0%
帮助的人:42.3万
展开全部
看一下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') 。
书宬
2010-08-26 · TA获得超过7849个赞
知道大有可为答主
回答量:2125
采纳率:75%
帮助的人:3268万
展开全部
regress(y',x1')
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式