Reshaping 2x52 array into 1 special row

I am wondering how I can reshape an array into the format that I need.
I currently have an array structured as:
A B
C D
E F
G H
etc.
However I need it to be structured as:
A B C D E F G H
I'm unfamiliar with matlab and have little idea how to go about this. I thought reshape() may do the trick but I think that will just transpose columns and append one column after the other.
Any help is appreciated!

回答 (1 件)

Stephan
Stephan 2019 年 3 月 29 日

1 投票

A = [1 2; 3 4; 5 6; 7 8]
B = reshape(A',1,[])
gives:
A =
1 2
3 4
5 6
7 8
B =
1 2 3 4 5 6 7 8

この質問は閉じられています。

質問済み:

2019 年 3 月 29 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by