How to copy rows of a matrix to convert it into single row??

4 views (last 30 days)
Suppose I have got A=[1 2; 3 4; 5 6; 7 8]
Now I want output as B=[1 2 3 4 5 6 7 8]
How to do this?
Thanx

Accepted Answer

Star Strider
Star Strider on 6 Apr 2016
Use the reshape function:
A=[1 2; 3 4; 5 6; 7 8];
B = reshape(A', 1, [])
B =
1 2 3 4 5 6 7 8

More Answers (0)

Categories

Find more on Matrices and Arrays 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!