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!