19252

Dimensions of matrices being concatenated are not consistent in 1x6802 double and 6802x1 double data
Question:
I want to export m file signal to matfile in simulink. Here I am having a problem. My code is
Y;
X;
T;
K=zeros(1,6802);
for n=1:10:6800;
angle=atan((Y(n+10)-Y(n))/(X(n+10)-X(n)));
K(n)=angle;
end
yt=[T;K],
plot(T,K)
The error message is <strong>Error using vertcat Dimensions of matrices being concatenated are not consistent. Error in work1 (line 20415) yt=[T;K],</strong>
Here K=1x6802 double and T=6802x1 double. I have gone through similar problems and solution but exactly not found my answer. It would be very helpful if someone helps me in solving the issue. Thanks in advance.
Answer1:Given the dimensions of K
and T
, you will have to transpose (the '
operator) one in order to combine into a new matrix:
yt=[T';K]; % dimensions will be 2x6802