How to joint together two matrix?
1 回表示 (過去 30 日間)
古いコメントを表示
I have these two matrix
A = 4 4 4 4 B = 1 2 3 4
3 3 3 3 1 2 3 4
2 2 2 2 1 2 3 4
1 1 1 1 1 2 3 4
I want to get together both, like this
C = 4,1 4,2 4,3 4,4
3,1 3,2 3,3 3,4
2,1 2,2 2,3 2,4
1,1 1,2 1,3 1,4
There is some function for this?
0 件のコメント
回答 (2 件)
Kevin Phung
2019 年 2 月 25 日
A =[4 4 4 4 ;3 3 3 3;2 2 2 2;1 1 1 1];
B = repmat(1:4,4,1);
C = cell(1,numel(A));
for i = 1:numel(A)
C{i} = [A(i) B(i)];
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Other Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!