How can we join two matrices of two dimmention

1 次查看(过去 30 天)
hey everybody i have two matrices of 476*11 i want to join them in one matrix of 952*11 . thanks in advance

采纳的回答

Mischa Kim
Mischa Kim 2014-3-12
编辑:Mischa Kim 2014-3-12
Abdulkareem, simply use
C = [A; B];
where A and B are your 476-by-11 matrices.
A = [1 2 3; 4 5 6];
B = [9 8 7; 6 5 4];
C = [A; B]
C =
1 2 3
4 5 6
9 8 7
6 5 4

更多回答(3 个)

Sagar Damle
Sagar Damle 2014-3-12
For two matrices A and B; 1. for horizontal concatenation,use [A,B] or horzcat(A,B). 2. for vertical concatenation,use [A;B]. Also see help about function 'cat()'.

Chris C
Chris C 2014-3-12
编辑:Chris C 2014-3-12
Write it as below assuming that matrix B and A are of the same dimension.
C = [B;A];

nl2605
nl2605 2014-3-12
C = horzcat(A,B); If A and Bb are the two matrices.

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by