rearrange matrix to vector

3 views (last 30 days)
Knut Tutgut
Knut Tutgut on 8 Oct 2015
Commented: Knut Tutgut on 8 Oct 2015
Hi! I need to rearrange a matrix A into a vector B as follow: A = [1,2;3,4;5,6] B = [1 2 3 4 5 6] What's the simplest way to do this? Thanks a lot, Knut

Accepted Answer

Thorsten
Thorsten on 8 Oct 2015
B = reshape(A', 1, []);

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!