Reshaping 2x52 array into 1 special row
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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!
Answers (1)
Stephan
on 29 Mar 2019
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
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!