How do I use regress function with 6 input variables?
显示 更早的评论
Hi,
I have 6 input variable in my function, following the example by matlab i did the next code:
y=A(1:38,:);
v=A(39:76,:);
d=A(77:114,:);
vi=A(115:152,:);
v2=v.^2;
v3=v.^3;
v4=v.^4;
X = [ones(size(v)) v2 v3 v4 d vi];
b = regress(y,X);
y is a matrix 38*25 and X 38*150
but, i have the next error:
Y must be a vector and must have the same number of rows as X.
I don't know how do column vectors... Anybody knows?
I see that rows of X have to be the number of elements of matrix y.
Thanks.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!