MATLAB: Cell array converts to matrix, how

cell arrays convert to matrix

I want to convert cell 'A' to a matrix 'B'.
A=
columns 1 through 10
{1×1 cell} {1×1 cell} {1×1 cell} {1×1 cell}…
columns 1 through 20
{1×1 cell} {1×1 cell} {1×1 cell} {1×1 cell}…
I want to have a 'B' as:
B =
1 2 3 4 5 6 7 8 9 ... 20
I tried B(1)=cell2mat(A{1}), but can I avoid doing it one by one?
Thanks!

Best Answer

B = [A{:}];
B = [B{:}];