print all elements of matrix in single row

12 views (last 30 days)
raj singh
raj singh on 13 Dec 2014
Answered: Star Strider on 13 Dec 2014
I have a matrix A=[1 2;3 4]; i wan to single row with all elements of A like like this
B=[1 2 3 4]
Please help me

Answers (1)

Star Strider
Star Strider on 13 Dec 2014
This works:
A=[1 2;3 4];
B = A(:).';

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!