MATLAB: How to rearrange all row elements into a single row

rearrangereshape

I have a matrix, m*n ,
b =
0011
1110
1100
0000
1101
0010
0111
1011
0011
0011
now i want to make a row matrix of size [1*(m*n)] or [1*40] in the above case, where elements of each row are put next to previous row: i.e.
d= [row(1)of b row(2) of b row(3) of b and so on]
i have tried reshape function, but it reshapes the matrix column wise. Kindly help

Best Answer

b=[0 0 1 1;1 1 1 0; 1 1 0 0;0 0 0 0]
b=b(:)'
%or maybe you want
b=[0 0 1 1;1 1 1 0; 1 1 0 0;0 0 0 0]
b=b'
b=b(:)'
It's good also to know that you can do it with reshape function
b=[0 0 1 1;1 1 1 0; 1 1 0 0;0 0 0 0]
reshape(b',1,[])