How to merge tow rows in one row?

조회 수: 1 (최근 30일)
Mr.Hamza
Mr.Hamza 2021년 3월 13일
댓글: Mr.Hamza 2021년 3월 13일
Hello every body
1 2 3 4
5 6 7 8
9 10 11 12
I have the above matrix and i want to merge the first and second row to be like that:
B = [ 1 2 3 4 5 6 7 8 ].

답변 (1개)

Alan Stevens
Alan Stevens 2021년 3월 13일
Like so
A = [ 1 2 3 4
5 6 7 8
9 10 11 12];
B = [A(1,:) A(2,:)];

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by