How to joint together two matrix?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Kevin Phung
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!