How to convert 4 x 4 matrix into row matrix

25 views (last 30 days)
Raza Ali
Raza Ali on 24 Feb 2014
Commented: Raza Ali on 24 Feb 2014
I need to convert a 4 x 4 matrix into single row matrix
like
A=[1 2 3 4;
5 6 7 8;
9 10 11 12;
13 14 15 16]
into [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 24 Feb 2014
Edited: Azzi Abdelmalek on 24 Feb 2014
A=A'
A=A(:)'
%Or
reshape(A',1,[])

Community Treasure Hunt

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

Start Hunting!