Rearrange matrix into single row
Ältere Kommentare anzeigen
Hey there, I have a matrix that looks like this
b=1 2 3 4
1 2 3 4
1 2 3 4
What do I have to do to arrange it into a single row vector[ 1 2 3 4 1 2 3 4 1 2 3 4]?
Akzeptierte Antwort
Weitere Antworten (1)
James Tursa
am 10 Aug. 2018
Bearbeitet: James Tursa
am 10 Aug. 2018
result = reshape(b.',1,[]);
The transpose is needed to get the row values to line up in memory first before doing the reshape.
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!