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,:)];
  1 件のコメント
Mr.Hamza
Mr.Hamza 2021 年 3 月 13 日
it is perfect, thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by