How to joint together two matrix?
1 view (last 30 days)
Show older comments
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 Comments
Answers (2)
Kevin Phung
on 25 Feb 2019
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 Comments
See Also
Categories
Find more on Other Formats in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!