merging two matrices (cell matrices)
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have two Matrices of dimension A=(63x181) and B=(63x181) I wish to get a matrix 'C' which has its first column from A and 2nd column from B. Then 3rd column from A and 4rth Column from B and so on till the end.
So, Matrix C will have 63 rows and 362 columns (181*2). Order of rown should remain the same.
I am using this code but it only writes one row. Doesn't write the full 63 rows of each column.
for m=2:2:362;
n=m-1;
x=m/2;
C{:,n}=A{:,x};
C{:,m}=B{:,x};
end;
Your help will be highly appreciated. I wonder if there is any builtin function like Cat(), vertcat() to for this.
Regards
AMD.
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!