How to split a matrix into 2 matrixes then join it again?

4 次查看(过去 30 天)
I have a mtrix like this: A =[2,6,3,1,7;9,4,2,6,3;7,1,4,5,3;7,2,5,6,3;4,2,5,3,5]
A =
2 6 3 1 7
9 4 2 6 3
7 1 4 5 3
7 2 5 6 3
4 2 5 3 5
then i want to split it become 2 matrix A1 and A2. So it will be like this:
A1 =
2 6 3 1 7
9 4 2 6 3
7 1 4 5 3
A2 =
7 2 5 6 3
4 2 5 3 5
After i finish with my process with that 2 matrix above, I want join them again into a matrix.
What to do? Thanks before :)

采纳的回答

Jan
Jan 2012-5-7
A =[2,6,3,1,7;9,4,2,6,3;7,1,4,5,3;7,2,5,6,3;4,2,5,3,5];
A1 = A(1:3, :);
A2 = A(4:5, :);
B = cat(1, A1, A2); % Or [A1; A2]
These basic array operations are explained exhaustively in the Getting started chapters of the documentation.

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by