help with horzcat error
显示 更早的评论
Hello,
nobs = length(hpc);
x = log(gdp);
n = log(hpc);
c = log(cy);
x = x-x(1);
n = n-n(1);
dx = x(2:nobs)-x(1:nobs-1);
dn = n(2:nobs)-alpha*n(1:nobs-1);
x = [dn,dx,c]; %the ordering of the variables
I declared my variables like above. gdp and hpc are nonstationary. They enter into the VAR as first difference but CY(consumption to output ratio) is stationary in level so I do not need to take the first difference of that. The problem is that when I run it, I got the error in below.
Which dataset? ("help ir" shows 12 options)
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Error in ir (line 267)
x = [dn,dx,c]; %the ordering of the variables
However, If I take the first difference of the CY as well, it runs perfectly. I mean x = [dn,dx,dc]; %the ordering of the variables. So is anyone can help me to solve my issue?
Lastly, the size of my data:
sx =
44 1
sn =
44 1
sc =
44 1
Best, Aysegul
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!